Forums / Install & configuration / Static cache - rewrite rules should include document_root?

Static cache - rewrite rules should include document_root?

Author Message

David Goddard

Friday 13 May 2005 3:26:45 am

Hi

Using 3.6.0rc1

Firstly I think the static cache feture is brilliant! A critical requirement for our setup.

I followed all the instructions at doc/features/3.6/staticcache.txt and it seemed to work, but I thought that logical place to put the cached files was under var/plain_user/static.

I updated settings/plain_user/staticcache.append.ini.php updated httpd.conf and remade the cache, but the rewrites were now failing. Why?

Well it appears that the original configuration worked because my filesystem doesn't have a directory /static, so after all the rewriting had been done, Apache was kindly also prefixing the path with the server's document_root.

However, my filesystem does have a /var and so Apache was no longer bothering to prefix the rewritten path with the server's document_root.

If people agree with this analysis I suggest the documentation should be updated so that the path in the rewrite rules should be prefixed with the document root, a bit like this:

RewriteCond /dat/ez.no/static/index.html -f
RewriteRule ^/$ /dat/ez.no/static/index.html [L]
RewriteCond /dat/ez.no/static/index.html -f
RewriteRule ^$ /dat/ez.no/static/index.html [L]

RewriteCond %{REQUEST_METHOD} !^POST$
RewriteCond /dat/ez.no/static$1/index.html -f
RewriteRule ^(.*)$ /dat/ez.no/static$1/index.html [L]

Does this sound right to the Apache gurus?

Cheers

David

Jan Borsodi

Wednesday 18 May 2005 5:01:51 am

I don't think that is necessary, adding the <i>DocumentRoot</i> and <i>Directory</i> directives should be enough.

  <Directory "/dat/ez.no">
    Options FollowSymLinks Indexes ExecCGI
    AllowOverride All
  </Directory>
  DocumentRoot "/dat/ez.no"

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq