This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Redirect all websites on IIS from non www
Author
Message |
bhavikap
Newbie


Joined: 04 July 2011
Posts: 1
Posted: 04 July 2011 at 7:36pm

Redirect all websites on IIS from non www to www url. Also not to redirect subdomains such as http://subdomain.example.com.

I have written the below in htaccess file, but is does not seem to work.

Also, there are other rules to be applied after the non www to www. For example http://www.example.com/browser.asp?Content=xyz to http://www.example.com/xyz/

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [I,RP]
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 05 July 2011 at 2:52am

Could you please specify the version of ISAPI_Rewrite you are using - 2 or 3.
The code above is for v3 but the post is in v2 forum...

__________________
Regards,
Anton
Back to Top
 

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

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum