mod_rewrite and RewriteCond usage

mod_rewrite and RewriteCond usage

Posted by: jdandrea
Posted on: 2006-06-26 20:11:00

Greetings! I recently added some mod_rewrite rules that map a good deal of my site to a common PHP script for handling. Alas, this also blocks some of the Dreamhost-mapped links ... like /stats/!

So ... I've written what I believe to be a correct mod_rewrite rule to ensure that accesses to the DreamHost /stats/ path (for Analog reports) can continue:

RewriteCond %{REQUEST_URI} !^http://www.my.site/stats/

Yet it keeps going to the handler anyway.

I also tried without the scheme/domain, without the scheme, without the regexp nomenclature, and so on. I suppose I've made some degree of pilot error, but haven't quite found it (yet). :)

Anyone have thoughts on how to navigate this one? Please advise - thanks!

- Joe

Re: mod_rewrite and RewriteCond usage

Posted by: Atropos7
Posted on: 2006-06-26 21:42:00

According to the DreamHost Wiki

It should be something like:

RewriteCond %{REQUEST_URI} ^/stats/(.*)$ 
RewriteRule ^.*$ - [L]

And those two lines should go before any of the rules related to the PHP script.


cool Atropos | openvein.org

Re: mod_rewrite and RewriteCond usage

Posted by: jdandrea
Posted on: 2006-06-27 05:20:00

Auugh! I checked the Wiki too. Apparently not thoroughly enough.

Thank you for catching that. I'll give it a shot.

- Joe

Tags: modrecently addeddreamhostrequest urirewrite rulesite statsphp scriptgreetingsadviseanalogsupposepathhttp