ExpiresActive On
ExpiresDefault "access plus 1 day"
[...]
RewriteRule .* index.php [L]
This are my settings for mod_expires plus the relevant RewriteRule. They work perfectly! But I have a specific URL, that shall not be cached. The regex for that would be ^/?nocache/
. Now that directory (/nocache/
) does not even physically exist; requests to it – as to every other directory – are handled by the “index.php”.
My first thought was to add a <LocationMatch>
around it, but the documentation sais, it is not allowed in the “.htaccess” context.
A <FilesMatch>
would be allowed but needs the file to physically exist, I think ((true?)).
Any ideas?
You can use
RewriteRule
directive in .htaccess: