The whole application has a global expires header set in the .htaccess I have a URL e.g. /current which I need like a different expiry header.
The whole application has a global expires header set in the .htaccess I have a URL e.g. /current which I need like a different expiry header.
Another solution could be to use Apache mod_setenvif and mod_headers to conditionally set cache headers.
I have not tried this specific configuration, but I have a similar one that sets environment variable with a RewriteRule directive and then uses Header to conditionally change Cache-Control directives
Use could use
<Location>
apache directive to define different options (e.g. expire) for specific URL.I'm assuming:
.htaccess files are searched for in every directory along the way to the file being served up if they're enabled starting at the docroot. Therefore, the easiest would be to put a new .htaccess file in the directory for which you wish to change the expire limit. If your site is www.foo.com and you want /current to have a different expire header a simple .htaccess file in www.foo.com/current. The file just needs:
This being said... a block in your httpd.conf file(s) for the entire server, a virtual host block, or in the docroot's .htaccess would be more elegant and manageable solutions.
A useful example that should integrate well with rewrites:
http://mark.koli.ch/2010/12/set-cache-control-and-expires-headers-on-a-redirect-with-mod-rewrite.html