Topic: several 301s in one hit?
|

|
| Author |
|
mark_s Newbie

Joined: 22 April 2009 Location: United Kingdom
Online Status: Offline Posts: 9
|
| Posted: 03 July 2009 at 7:16am | IP Logged
|
|
|
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 |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 9110
|
| Posted: 03 July 2009 at 8:25am | IP Logged
|
|
|
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 |
|
| |
mark_s Newbie

Joined: 22 April 2009 Location: United Kingdom
Online Status: Offline Posts: 9
|
| Posted: 06 July 2009 at 6:35am | IP Logged
|
|
|
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 |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 9110
|
| Posted: 06 July 2009 at 10:05am | IP Logged
|
|
|
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 |
|
| |
mark_s Newbie

Joined: 22 April 2009 Location: United Kingdom
Online Status: Offline Posts: 9
|
| Posted: 06 July 2009 at 10:35am | IP Logged
|
|
|
Thats brilliant, thank you very much for your help.
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
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
|