homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Rewrite with an exclusion
figment88




msg:1510873
 4:55 pm on May 16, 2006 (gmt 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.

 

Little_G




msg:1510874
 5:11 pm on May 16, 2006 (gmt 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

figment88




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

Thanks Andrew that did the trick.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved