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: several 301’s in one hit? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mark_s
Newbie
Newbie


Joined: 22 April 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 03 July 2009 at 7:16am | IP Logged Quote mark_s

Hi, I have 6 domains which need the below 301's applied to them.  Is it possible to do this in one rule?  Also, i need it to work with/without the www. prefix..?

www.domain.org/lang1 = www.lang1.domain.org
www.domain.org/lang2 = www.lang2.domain.org
www.domain.org/lang3 = www.lang3.domain.org
www.domain.org/lang4 = www.lang4.domain.org
www.domain.org/lang5 = www.lang5.domain.org
www.domain.org/lang6 = www.lang6.domain.org

Is this possible?

Thanks in advance.




Back to Top View mark_s's Profile Search for other posts by mark_s
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 9110
Posted: 03 July 2009 at 8:25am | IP Logged Quote Anton

Sure it's possible. The config for v2 is:

[ISAPI_Rewrite]

RewriteCond Host: (?:www\.)?domain\.org
RewriteRule /(lang1|lang2|lang3|lang4|lang5|lang6) http\://www.$1.domain.org [I,RP]

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


Joined: 22 April 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 06 July 2009 at 6:35am | IP Logged Quote mark_s

Thanks Anton, that worked wonders.  However after looking into this more, it appears that I was incorrect.

I need it so that no matter which domain is hit, the user needs to get directed to the site, without the www. prefix (http://domain.org). Can this be acheived in the rule you have given me already by modifying it?

RewriteCond Host: (?:www\.)?domain\.org
RewriteRule /(lang1|lang2|lang3|lang4|lang5|lang6) http\://www.$1.domain.org [I,RP]

and would this work for a general url query i.e www.lang1.domain.org to get changed to http://lang1.domain.org

many thanks!!!



Back to Top View mark_s's Profile Search for other posts by mark_s
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 9110
Posted: 06 July 2009 at 10:05am | IP Logged Quote Anton

Please try to fix your config like this:

RewriteCond Host: (?:www\.)?domain\.org
RewriteRule /(lang1|lang2|lang3|lang4|lang5|lang6) http\://$1.domain.org [I,RP]

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

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


Joined: 22 April 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 06 July 2009 at 10:35am | IP Logged Quote mark_s

Thats brilliant, thank you very much for your help.
Back to Top View mark_s's Profile Search for other posts by mark_s
 

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