I need some help with regular expressions / Apache rewritrerule

Author Message

Nick Woods

Thursday 08 April 2004 8:06:38 am

I've ecently implemented the Apache rewrite rule (see http://ez.no/ez_publish/documentation/installation/virtual_host_setup ) and although the main website still works I now find that Squirrelmail has been broken and Ezpublish thinks that the Squirrelmail logon is an ezpublish module

This is what I added to Apaches httpd.conf file :-
RewriteEngine On
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

I guess I need to tune it to allow squirrelmail to work - the path is squirrelmail/src/login.php

Can someone tell me what Ineed to do to the Rewriterule to fix this ?

Thanks

Björn Dieding@xrow.de

Tuesday 13 April 2004 5:40:14 am

try this
RewriteEngine On
RewriteRule ^/squirrelmail(.*)$ /squirrelmail$1 [L]
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Nick Woods

Tuesday 13 April 2004 1:15:17 pm

Thanks Bjorn, I'll try this out.

Nick Woods

Wednesday 14 April 2004 3:15:42 pm

Hi Bjorn

Unfortunately it didnt work. After a bit of digging around in my httpd.conf files (it was setup by the ISP when we rented the server) I eventually found that there was an alias command for /squirrelmail and the rewrite rule kept clashing with it.

Rather than change the alias (because of the way the webser appliance is set up) i found that using rewritecond worked :-

RewriteEngine On
RewriteCond %{REQUEST_URI} !(^/squirrelmail(.*))
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

Thanks once again for your help - although your idea didnt work you did give me the confidence to hunt around and work it out for myself !

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:34:57
Script start
Timing: Jan 18 2025 19:34:57
Module start 'layout'
Timing: Jan 18 2025 19:34:57
Module start 'content'
Timing: Jan 18 2025 19:34:57
Module end 'content'
Timing: Jan 18 2025 19:34:57
Script end

Main resources:

Total runtime0.0190 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.2891152.6563
Module start 'layout' 0.00690.0031 741.945339.5078
Module start 'content' 0.01010.0063 781.453193.3984
Module end 'content' 0.01630.0026 874.851634.3047
Script end 0.0189  909.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002815.0197140.0002
Check MTime0.00126.0846140.0001
Mysql Total
Database connection0.00094.698910.0009
Mysqli_queries0.003015.569230.0010
Looping result0.00000.120710.0000
Template Total0.002111.210.0021
Template load0.00105.521310.0010
Template processing0.00115.643210.0011
Override
Cache load0.00063.180010.0006
General
dbfile0.00042.040880.0000
String conversion0.00000.059140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs