Welcome to WebmasterWorld Guest from 54.147.10.12

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Rewrite with an exclusion

     
4:55 pm on May 16, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 25, 2002
posts:776
votes: 0


I'm rewriting all non-www URL's to www ones with


RewriteEngine on
RewriteCond %{HTTP_HOST} ^DOMAIN\.com
RewriteRule (.*) http://www.DOMAIN.com/$1 [R=301,L]

This messes up the Awstats on my shared host because it can nolonger find the config file. It seems to construct the filename from the request URI.

So, how do I exclude just
[DOMAIN.com...]

from the rewrite.

This seems like it should be easy and have multiple solutions, but I can't get it to work.

5:11 pm on May 16, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 11, 2006
posts:481
votes: 0


Hi,

Try something like:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^DOMAIN\.com
RewriteCond %{REQUEST_URI} !cgi-bin/awstats\.pl
RewriteRule (.*) http://www.DOMAIN.com/$1 [R=301,L]

Andrew

5:34 pm on May 16, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 25, 2002
posts:776
votes: 0


Thanks Andrew that did the trick.