This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: mydomain to www.mydomain with exception
Author
Message |
fs100
Newbie


Joined: 25 April 2010
Location: United States
Posts: 8
Posted: 19 October 2011 at 10:25pm

i successfully can 301 to www.mydomain with the code from
the example page. I need to exclude stats.mydomain to view
our web statistics.


__________________
fs
Back to Top Visit fs100's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 20 October 2011 at 2:27am

Please modify the example like this:

RewriteEngine on

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{HTTP:Host} !^stats\.mydomain [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

__________________
Regards,
Anton
Back to Top
 
fs100
Newbie


Joined: 25 April 2010
Location: United States
Posts: 8
Posted: 20 October 2011 at 11:49am

Works perfect. Thanks for your help.

__________________
fs
Back to Top Visit fs100's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version