Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are having an issue with FilesMatch, it does not seem to be matching some file types. We are using the FilesMatch directive to allow me to add custom headers using mod_headers, config file details snippit below:

<FilesMatch  \.(list|dept|png|html|htm)>
Header set Last-Modified  "Mon, 01 Jan 2000 00:00:00 GMT"
Header set Expires "Mon, 01 Jan 2000 00:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
Header set Pragma "no-cache"
</FilesMatch>

We are using mod_jk to pass connections to Tomcat and the Struts to rename the files to .dept & .list ,etc.

The issue appears to be with matching the text/html files that are being served as files with .png (used in the regex match for sanity check) are matching fine.

Is there a specific file extension that I should be trying to match in apache when the files are being renamed with struts?

share|improve this question
    
How is struts "renaming" the files? With a redirect? Or by reading a different filename? In other words, does the original requested URL contain a matching filetype? –  Robin Green Apr 15 '11 at 19:15
    
Struts is renaming the file with a redirect –  user78560 Apr 19 '11 at 14:08

1 Answer 1

I have managed to resolve the issue by using LocationMatch

<LocationMatch "\.(html|htm|shtml|shtm|txt|text)$" >
Header set Custom-Header1
....
</LocationMatch>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.