Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: no www to www Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
acer152
Newbie
Newbie


Joined: 10 April 2007
Online Status: Offline
Posts: 28
Posted: 30 May 2008 at 10:46am | IP Logged Quote acer152

I need to rewrite the URL to include www is the domain is referenced without it.

so if you access http://mydomain.com/myfld/mypage, then it will go to http://www.mydomain.com/myfld/mypage

Also, there will be live subdomains, so these should still work as they are:

http://sub1.mydomain.com/myfld/mypage  is fine

So, the redirect rule is only if accessing without www, like http://mydomain.com/myfld/mypage
Back to Top View acer152's Profile Search for other posts by acer152
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7559
Posted: 30 May 2008 at 11:31am | IP Logged Quote Lexey

RewriteCond Host: mydomain\.com
RewriteCond METHOD GET|HEAD
RewriteCond %HTTPS (on)|.*
RewriteRule (.*) http(?1s:)\://www.mydomain.com$2 [I,RP]
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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