在.htaccess文件中,可以为给定扩展名设置模仿类型,例如:
AddType application/javascript .js
一个人如何为单个文件而不是扩展名设置模仿类型?我在同一个文件夹中有一个Javascript与其他Javascript文件需要不同的模仿类型。
AddType application/javascript .js
AddType application/ecmascript specialfile.js
第二行不起作用。
最佳答案
您可以使用<files>
容器来匹配文件的名称,然后再为其添加类型:
<Files specialfile.js>
AddType application/ecmascript .js
</Files>
关于apache - htaccess设置单个文件的模仿类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15628826/