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: Redirect no www to www BUT NOT subdomain
Author
Message |
darka
Newbie


Joined: 13 March 2008
Posts: 12
Posted: 20 December 2011 at 7:54am

Hi Guys help needed please.

I'm using:

RewriteEngine on

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

to redirect all non www to the www HOWEVER I need anything on the domain address: direct.domain.com to remain at direct.domain.com and not add the www.direct.domain.com as what is currently happening.

Thanks for any help
Cheers
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 21 December 2011 at 8:20am

Hello,
try to hardcode the domain name:


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

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

Printable version Printable version