FilesMatch not matching files 100% of the time
When trying to use FileMatch to match a list of file types (by extension) it is working as expected most of the time, however for some files it is failing to match in particular .js files. In some case开发者_JAVA技巧s the .js files are having the rule apply and in some cases they are not, what could cause this behaviour?
Code being used:
<FilesMatch "\.(gif|jpe?g|png|css|js|htc|xml|ico)$" >
Header unset Cache-Control
</FilesMatch>
Note that we are setting the Cache-Control header further up in the apache config.
I've solved the problem by using LocationMatch
<LocationMatch "\.(html|htm|shtml|shtm|txt|text)$" >
Header set Custom-Header1
....
</LocationMatch>
精彩评论