本文介绍了htaccess设置单个文件的模仿类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在.htaccess文件中,可以为给定扩展名设置模仿类型,例如:
In an .htaccess file one might set the mimetype for a given extension like:
AddType application/javascript .js如何为单个文件而不是扩展名设置模仿类型?我有一个Javascript与同一个文件夹中的其他Javascript文件需要不同的模仿类型。
How would one set the mimetype for a single file instead of an extension? I have one Javascript that needs a different mimetype than other Javascript files in the same folder.
AddType application/javascript .js AddType application/ecmascript specialfile.js第二行不起作用。
推荐答案您可以使用< files> 容器来匹配文件名,然后再添加
You can use the <files> container to match the file's name before adding a type for it:
<Files specialfile.js> AddType application/ecmascript .js </Files>更多推荐
htaccess设置单个文件的模仿类型
发布评论