2

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?

2
  • 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? Apr 15, 2011 at 19:15
  • Struts is renaming the file with a redirect
    – user78560
    Apr 19, 2011 at 14:08

1 Answer 1

2

I have managed to resolve the issue by using LocationMatch

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .