statcache
statcache copied to clipboard
Trouble with Apache setup
Uncached pages work fine, but anything which has been cached throws a 404. Here's my config
RewriteCond %{DOCUMENT_ROOT}/versant-homes/statcache%{REQUEST_URI}/~index.html -f
RewriteRule ^(.*)$ versant-homes/statcache/$1~index.html [L,QSA]
RewriteCond %{DOCUMENT_ROOT}/versant-homes/statcache%{REQUEST_URI} -f
RewriteRule ^(.*)$ versant-homes/statcache/$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ versant-homes/index.php?q=$1 [L,QSA,NC]
Any ideas would be great!
I don't have any apache setups available atm—I prefer nginx—but could it be that the rules are capturing the opening slash resulting in two slashes when used in the replacement? IOW, should the rules look like this instead:
RewriteRule ^/(.*)$ versant-homes/statcache/$1 [L,QSA]
^ notice the opening slash not within the capture for $1
Actually, a different suggestion was just to add an initial slash to the rule target, e.g.
RewriteRule ^(.*)$ /versant-homes/statcache/$1~index.html [L,QSA]