在.htaccess MIME类型带或不带前导点前导、不带、类型、htaccess

2023-09-02 09:50:02 作者:银海属于天朝阿!

我有玩在Firefox MP4(难怪有)一些问题。在大多数情况下,有人建议增加一些MIMI类型在我的.htaccess文件。是这样的:

 将AddType视频/ MP4 MP4 M4V
将AddType音频/ MP4 M4A
将AddType视频/ OGG远洋船
将AddType音频/ OGG格式OGG OGA
将AddType视频/ W​​EBM WEBM
 

有些人提出的相同,但有一个前导点

 将AddType视频/ MP4的MP4的.m4v
将AddType音频/ MP4。M4A
将AddType视频/ OGG的.ogv
将AddType音频/ OGG .OGG .oga
将AddType视频/ W​​EBM .webm
 

什么是这两个片段之间的区别是什么?

解决方案   

扩展参数是不区分大小写的,并且可以带或不带前导点指定。

因此​​,在短期它没有什么区别,它们都将实现相同的结果。 了解更多关于将AddType这里。

上传漏洞,后端黑白名单绕过 21

I have some issues with playing mp4 in Firefox (no surprise there). Most of the time, it was suggested to add some MIMI types in my .htaccess file. Something like:

AddType video/mp4 mp4 m4v
AddType audio/mp4 m4a
AddType video/ogg ogv
AddType audio/ogg ogg oga
AddType video/webm webm

Some people suggested the same, but with a leading dot

AddType video/mp4 .mp4 .m4v
AddType audio/mp4 .m4a
AddType video/ogg .ogv
AddType audio/ogg .ogg .oga
AddType video/webm .webm

What's the difference between those two snippets?

解决方案

The extension argument is case-insensitive and can be specified with or without a leading dot.

So in short it makes no difference, they will both achieve the same result. Read more about AddType here.