Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule and stats problem

         

Bonusbana

8:09 am on Sep 2, 2004 (gmt 0)

10+ Year Member



Hi

I have some rewrite rules like:

RewriteRule ^([^/]+)/([^/]+)\.html?$ /index\.php?section=$1&ark=$2
RewriteRule ^([^/]+)/([^/]+)/$ /index\.php?section=$1&ark=$2
RewriteRule ^([^/][^missing]+)\.html?$ /index\.php?section=$1
RewriteRule ^([^/]+)/$ /index\.php?section=$1

This works great, except when I try to access my stats page located at domain.com/stats/ the rewriterule thinks its a domain.com/index.php?section=stats and then fails to load.

Is it possible to exclude a directory from the rewrite rules?

thanks
David

RonPK

9:39 am on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can put a condition before the RewriteRule, like this:

RewriteCond %{REQUEST_URI} !/stats 
RewriteRule ... [L]

The! before /stats means 'not'.