ez.no / exponential / documentation / configuration / configuration / tips & tricks / exclude uris from rewrite
If you have set up virtual hosts and want to exclude certain URIs from the rewrite, e.g. for other scripts like a webmail script at http://www.example.com/webmail or a stats script at http://www.example.com/stats you can do the following.
In your httpd.conf rewrite rule use
RewriteRule !(^/stats/.*$|^/webmail/.*$|(gif|css|jpg|png|js|asf|avi|wmv|swf|xsl|jar))$ /<your path to>/index.php
for the above example URIs to be excluded from the rewrite.
You will need to avoid the words stats and webmail as first level nodes in your site when using url_alias (nice urls).
Thanks to Paul Borgermans
Log in or create a user account to comment.
Comments
check for .htaccess
Dmitry Yakovlev
Tuesday 24 February 2004 12:53:58 pm
Rewrite conditions
Harry Oosterveen
Thursday 16 October 2003 11:00:01 pm
RewriteCond %{REQUEST_URI} !^/(stats|webmail)/.*$
RewriteRule !\.(gif|css|jpg|png|js|asf|avi|wmv|swf|xsl|jar)$ /<your path to>/index.php
Error in virtual host code - dot missing
Chris Winchester
Wednesday 09 July 2003 4:44:05 pm
RewriteRule !(^/stats/.*$|^/webmail/.*$|\.(gif|css|jpg|png|js|asf|avi|wmv|swf|xsl|jar))$ /<your path to>/index.php
There needs to be a dot before the (gif|css|...) etc, or Apache treats these as filenames rather than extensions, and most of the graphics/stylesheets on your site will disappear!
I'm a bit of a newbie, but just discovered this by trial and error...
- Chris