Forum Moderators: phranque
Anyway, can anyone tell me why in the world this is giving me a 500 error?
#### Code snip. The rest is below.
<Files about.html contact.html plugs.html>
Header unset Cache-Control
Header append Cache-Control "max-age=2592000"
</Files>
The problem is with having the list of files in the the Files directive tag. If I get rid of all but one (<Files about.html>), it works fine. To my knowledge, this is the correct way of listing multiple files.
And can anyone tell me if this looks good? Anything I should add? I've been trying to wrap my brain around this cache control stuff for a while, but I still feel a bit iffy on the subject.
#### cache control ####
#Default html cache
<FilesMatch \.html$>
Header append Cache-Control "max-age=86400"
</FilesMatch>
# Cache for pages that don't get updated often
<Files about.html contact.html plugs.html>
Header unset Cache-Control
Header append Cache-Control "max-age=2592000"
</Files>
#.css and images. I'll combine these 2 when I can figure out the above problem
<FilesMatch \.css$>
Header append Cache-Control "max-age=2592000"
</FilesMatch>
<FilesMatch \.(gif¦jpg¦jpeg¦bmp)>
Header append Cache-Control "max-age=2592000"
</FilesMatch>
#### / cache control ####
Thanks. :)
Welcome to WebmasterWorld!
> To my knowledge, this is the correct way of listing multiple files.
The reason you're having problems is that the basic <Files [httpd.apache.org]> directive does not support multiple files at all.
However, you may use the special extended regular-expressions version of <Files>, or use the <FilesMatch> directive to accomplish your goal using the "OR" function of regular expressions.
<Files> ~ "(about¦contact¦plugs)\.html$"
-or-
<FilesMatch> "(about¦contact¦plugs)\.html$"
Jim
Let's start with that <Files> [httpd.apache.org] container. One file, not a list. To incorporate a list of files you need to use regular expression matching.
<added>
Too slow this morning ;)
Thanks jd --
</added>
The code
<Files foo.bar>
Deny from all
</Files> Jim