Share » Forums » Setup & design » I need some help with regular...

I need some help with regular expressions / Apache rewritrerule

I need some help with regular expressions / Apache rewritrerule

Thursday 08 April 2004 8:06:38 am - 3 replies

Author Message

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 !

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu