1

I am using CE Cache Static driver. All is getting cached and served as expected except for the home page. It is getting cached, but not served. I believe it is due to the below line of the htaccess, as the _static_cache_handler.php script is NOT being triggered:

RewriteCond %{DOCUMENT_ROOT}/static_cache/ce_cache/90ba68/static%{REQUEST_URI}/index\.html -f

So, despite the fact that index.html exsists in the ce_cache/90ba68/static directory, the RewriteCond is not passing.

This is working for me on other servers, but not the one I'm on now.

Any ideas?

EDIT

I can access the cached file in the browser with no issue, so I don't think it is a permissions issue.

1 Answer 1

2

I think I've found the issue and solution. It seems sometimes mod_dir will be setup to do it's thing before mod_rewrite. This means that %{REQUEST_URI} for the homepage could end up being index.php instead of /.

To account for this, I updated the the htaccess rule:

#------------------- CE Cache Static Driver -------------------
RewriteCond %{REQUEST_URI} !^/admin [NC]
RewriteCond %{QUERY_STRING} !ACT|URL [NC]
RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond %{DOCUMENT_ROOT}/static_cache/ce_cache/90ba68/static%{REQUEST_URI}/index\.html -f [OR]
RewriteCond %{REQUEST_URI} ^/(?:index\.php)$
RewriteCond %{DOCUMENT_ROOT}/static_cache/ce_cache/90ba68/static/index\.html -f 
RewriteRule (.*) /_static_cache_handler.php%{REQUEST_URI}/index\.html [L,QSA]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.