Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Static Publisher .htaccess not working on the live server


Reply

2 Posts   366 Views

Avatar
joern

12 April 2013 at 4:07am Community Member, 28 Posts

hi,
i'm trying to push the performance of my SS 3.1.beta instance a bit further and implemented the FileSystemPublisher.
On my local MAMP system everything works fine, but it seems that the "check and redirect to cache" rules aren't catching the requests.

I'm not very familiar with htaccess-stuff but is it possible that my hoster disabled some of the required variables. My regular mod_rewrite rules are working like a charm.

any ideas?

# Cached content - live webserver
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_URI} /(.*[^/])/?$
RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /cache/%1.html [L]

Avatar
joern

13 April 2013 at 12:32am (Last edited: 13 April 2013 12:32am), Community Member, 28 Posts

I did a couple of tests and found a strange behavior with the DOCUMENT_ROOT variable.
On my local environment %{DOCUMENT_ROOT} and _SERVER["DOCUMENT_ROOT"] are pointing to the same directory but they differ on the live server and therefore the check that checks the existence of the cache file will always fail.

%{DOCUMENT_ROOT} = /opt/RZapache/htdocs
_SERVER["DOCUMENT_ROOT"]   /home/…/http/…/htdocs

Any Ideas how I can use the RewriteConditions without the DOCUMENT_ROOT variable?