Forums / Install & configuration / Rewrite rule for static cache (3.6)

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Rewrite rule for static cache (3.6)

Author Message

Tony Wood

Tuesday 03 May 2005 10:31:28 am

Hi,

Is there a eZ offical apache config for 3.6 that enables cache to work?

Is is possbile to doco this so we have a base that everybody uses. Of course, most sysadmins will customise, but I want to keep eZ secure so that everyone has the right, secure base.

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Frederik Holljen

Wednesday 04 May 2005 12:56:11 am

Take a look at the file "doc/features/3.6/staticcache.txt". I think you will find what you are looking for.

kracker

Wednesday 04 May 2005 1:21:54 am

hey hey hey,

For those without an imagination that can read documents remotely ...

Here is some great reading material

http://pubsvn.ez.no/nextgen/trunk/doc/features/3.6/
http://pubsvn.ez.no/nextgen/trunk/doc/features/3.6/staticcache.txt

//kracker

mc chris : fett's vett

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Tony Wood

Wednesday 04 May 2005 2:15:59 am

Thanks Frederik.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

J-A Eberhard

Monday 16 May 2005 2:46:29 am

Hi,

I read the staticcache.txt file but still confused on how to integrate the given rule

RewriteEngine On

RewriteLog    /tmp/rewrite
RewriteLogLevel 4

RewriteCond   /var/www/mydomain/static/fr/index.html -f
RewriteRule  ^/$              /static/fr/index.html [L]
RewriteCond   /var/www/mydomain/static/fr/index.html -f
RewriteRule  ^$               /static/fr/index.html [L]

RewriteCond   /var/www/mydomain/static/en/index.html -f
RewriteRule  ^/$              /static/en/index.html [L]
RewriteCond   /var/www/mydomain/static/en/index.html -f
RewriteRule  ^$               /static/en/index.html [L]

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

RewriteRule !\.(gif|css|jpg|png|jar|ico|js)$ /index.php

with my current apache virtual host config as shown below.


<VirtualHost *>
	DocumentRoot /var/www/mydomain

        ServerName www.mydomain.com
	ServerAlias mydomain.com

       <Directory /var/www/mydomain>
            Options FollowSymLinks
            AllowOverride None
       </Directory>
         
                RewriteEngine On
                RewriteCond %{REQUEST_URI} !^/webmail.*
                RewriteCond %{REQUEST_URI} !^/cgi-bin.*
                RewriteCond %{REQUEST_URI} !^/help.*
                RewriteCond %{REQUEST_URI} !^/robots.txt
                RewriteCond %{REQUEST_URI} !^/extension.*
                RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php
</VirtualHost>

my guess was to integrate it this way

<VirtualHost *>
        
	DocumentRoot /var/www/mydomain

        ServerName www.mydomain.com
	ServerAlias mydomain.com

       <Directory /var/www/mydomain>
            Options FollowSymLinks
            AllowOverride None
       </Directory>
         
                RewriteEngine On
                RewriteCond %{REQUEST_URI} !^/webmail.*
                RewriteCond %{REQUEST_URI} !^/cgi-bin.*
                RewriteCond %{REQUEST_URI} !^/help.*
                RewriteCond %{REQUEST_URI} !^/robots.txt
                RewriteCond %{REQUEST_URI} !^/extension.*
                
		RewriteLog    /tmp/rewrite
		
		RewriteLogLevel 4

		RewriteCond   /var/www/mydomain/static/fr/index.html -f
		RewriteRule  ^/$              /static/fr/index.html [L]
		RewriteCond   /var/www/mydomain/static/fr/index.html -f
		RewriteRule  ^$               /static/fr/index.html [L]

		RewriteCond   /var/www/mydomain/static/en/index.html -f
		RewriteRule  ^/$              /static/en/index.html [L]
		RewriteCond   /var/www/mydomain/static/en/index.html -f
		RewriteRule  ^$               /static/en/index.html [L]

		RewriteCond   %{REQUEST_METHOD}       !^POST$
		RewriteCond   /var/wwww/mydomain/static$1/index.html -f
		RewriteRule   ^(.*)$  /static$1/index.html [L]	 
		
		RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php	 

</VirtualHost>

Can the Apache expert tells me if on the right track or could someone elaborate on the documentation for static caching?
Thanks
Jacques-André

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

J-A Eberhard

Wednesday 25 May 2005 12:43:58 am

Can't use the static cache in 3.6 yet.
Could anybody be kind enough to review my Rewrite rule?
Thanks...
JAE

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Łukasz Serwatka

Wednesday 25 May 2005 12:56:30 am

Hi,

This works fine for me. Just replace path with yours.

<VirtualHost *:80>
    DocumentRoot E:/WWW/ezpub360rc1
    ServerName test.ez
    ErrorLog logs/test_ez_error.log
    CustomLog logs/test_ez_access.log common
    <Directory E:/WWW/ezpub360rc1>
	Options FollowSymLinks Indexes ExecCGI
	AllowOverride None
    </Directory>
    RewriteEngine On

    RewriteCond   E:/WWW/ezpub360rc1/static/index.html -f
    RewriteRule   ^/$              /static/index.html [L]
    RewriteCond   E:/WWW/ezpub360rc1/static/index.html -f
    RewriteRule   ^$               /static/index.html [L]

    RewriteCond   %{REQUEST_METHOD}       !^POST$
    RewriteCond   E:/WWW/ezpub360rc1/static$1/index.html -f
    RewriteRule   ^(.*)$  /static$1/index.html [L]

    RewriteRule   !\.(js|gif|css|jpg|png|html)$ E:/WWW/ezpub360rc1/index.php
</VirtualHost>

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog