Welcome to WebmasterWorld Guest from 50.19.135.67

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Rewrite with an exclusion

     

figment88

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

WebmasterWorld Senior Member 10+ Year Member



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.

Little_G

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

5+ Year Member



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

figment88

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

WebmasterWorld Senior Member 10+ Year Member



Thanks Andrew that did the trick.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month