Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Global redirect for all domains Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
badknecap
Newbie
Newbie


Joined: 10 February 2010
Location: United States
Online Status: Offline
Posts: 1
Posted: 10 February 2010 at 10:43am | IP Logged Quote badknecap

I have the following in my global config file:

RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]

This redirects all traffic to include the "www." in front of the domain.  I hear this is best for SEO reasons.

Is there a way to do this so it does it for ANY domain that does not use the "www" in front of the domain?  Otherwise I have to do this for each site that we host.

Back to Top View badknecap's Profile Search for other posts by badknecap
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10488
Posted: 11 February 2010 at 2:29am | IP Logged Quote Anton

Yes, sure it's possible:

RewriteCond Host: (?!www\.)(.+)
RewriteRule (.*) http\://www\.$1$2 [I,RP]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

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