Htaccess sets mimetype type for single file

In the .htaccess file, you can set the mimetype type for this extension, for example:

AddType application/javascript .js 

How to set mimetype type for one file instead of extension? I have one Javascript that requires a different mimetype type than other Javascript files in the same folder.

 AddType application/javascript .js AddType application/ecmascript specialfile.js 

The second line does not work.

+4
source share
1 answer

You can use the <files> container to match the file name before adding a type for it:

 <Files specialfile.js> AddType application/ecmascript .js </Files> 
+7
source

All Articles