I am trying to add the expires headers to the static content of my pages. Through reading a few different helps on this and other sites, I've come across some things that I think I understand and other things I don't think I understand. Going off the example referenced above (the pennysmalls.com example), I should use something similar to the following:
# add something we can do a directory match on
RewriteCond %{QUERY_STRING} ^[0-9]{10}$
RewriteRule ^(.*)$ /add_expires_header%{REQUEST_URI} [QSA]
# the add_expires_header directory is just a symlink to public
<Directory "/path/to/myapp/public/add_expires_header">
ExpiresActive On
ExpiresDefault "access plus 6 months"
</Directory>
The author speaks of putting all this in the httpd.conf file. I do not know where that is in the hosting rails structure. It seems as though I should put the first half (and I initially thought the second half) of this code in the myapp/public/.htaccess file. I can parse it out in my mind and understand what it is doing, however, it breaks my server (and yes, I did create the symbolic link to the add_expires_header folder properly). I take out the second half and then the server is back up again. So I'm thinking that the second half must belong somewhere else, unless there is something else I'm missing or doing wrong. Is there a httpd.conf file I should know about? What I do understand (think that I understand anyway) is the code and what it is supposed to be doing. What I don't understand is where I am supposed to put the code for it to work together properly (in another thread in mentions a modules/mod_expires.so file - I don't know anything about that file either). Any suggestions?
2008-11-19 11:47 AM