I am using Stash static caching (and it is AWESOME). I'm using Stash 2.4.5, Mustash 1.0.9, and EE 2.7.2.
On my Mustash 'Static cache rewrite rules' page, in the example .htaccess code, it has the following lines:
# Check if cached index.html exists
RewriteCond /path/to/my/static_cache/1/$2/index.html (.*\.(.*))$
RewriteCond %1 -f
# Rewrite to the cached page
RewriteRule ^(index.php/*)*(.*)(/*) http://www.domain.com/static_cache/1/$2/index.%2 [L]
If I use that entire .htaccess
file as is, I get weird URLs as I navigate throughout my site. The first time I visit a page (no static cache file exists yet), the URL is fine (like http://www.domain.com/about
)... but the next time I visit it, I get a weird URL, like http://www.domain.com/static_cache/1/about/index.html
.
Another weird thing, when I visit the home page http://www.domain.com/
, if it's been cached, the url is http://www.domain.com/static_cache/1//index.html
. (notice the //).
. . . HOWEVER, I found that if I remove the domain part from
RewriteRule ^(index.php/*)*(.*)(/*) http://www.domain.com/static_cache/1/$2/index.%2 [L]
to make it
RewriteRule ^(index.php/*)*(.*)(/*) /static_cache/1/$2/index.%2 [L]
then caching works and my URL's are fine...
Everything seems to be working (with the exception of the issue I noted in this question (Stash static caching not ignoring POSTs like I think it should).
But it does seem like it's indicative of some underlying issue in the way I've set things up. I assume things should work normally with the example .htaccess file provided from that Mustash page. Any ideas what I've done wrong?