Conditionally 301 or redirect based on domain it came from
3 posts
• Page 1 of 1
Conditionally 301 or redirect based on domain it came from
Please HELP!
We have a dropdown list that allows our customer to switch from the page they are on to one of our other language sites with the same URL.
Example you are on http//www.spanish.es/About/AboutUs.asp and select English from the dropdown list which would redirect you to
http//www.english.com/About/AboutUs.asp
The problem I am having is trying to 301 redirect old links (for example on our English site) to new URL on (the English site) and only redirect old links from the other domains (Spanish, Chinese, German) to the new URL on the English site.
How do I distinguish within the English site which domain the link is coming from?
When I do the following it does not work:
RewriteCond Host: www\.spanish\.es
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.english\.com
RewriteRule /About/AboutUs\.html /About/AboutUs.asp [I,RP]
RewriteRule /faqlibraryan/.* /Support/FAQLibrary.asp [I,RP]
We have a dropdown list that allows our customer to switch from the page they are on to one of our other language sites with the same URL.
Example you are on http//www.spanish.es/About/AboutUs.asp and select English from the dropdown list which would redirect you to
http//www.english.com/About/AboutUs.asp
The problem I am having is trying to 301 redirect old links (for example on our English site) to new URL on (the English site) and only redirect old links from the other domains (Spanish, Chinese, German) to the new URL on the English site.
How do I distinguish within the English site which domain the link is coming from?
When I do the following it does not work:
RewriteCond Host: www\.spanish\.es
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.english\.com
RewriteRule /About/AboutUs\.html /About/AboutUs.asp [I,RP]
RewriteRule /faqlibraryan/.* /Support/FAQLibrary.asp [I,RP]
Re: Conditionally 301 or redirect based on domain it came fr
Hello,
"The problem I am having is trying to 301 redirect old links (for example on our English site) to new URL on (the English site) and only redirect old links from the other domains (Spanish, Chinese, German) to the new URL on the English site."
- You should specify the proper RewriteCond Host: directive before EACH rule depending on the domain:
RewriteCond Host: www\.spanish\.es
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.spanish\.es
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.english\.com
RewriteRule /About/AboutUs\.html /About/AboutUs.asp [I,RP]
RewriteCond Host: www\.english\.com
RewriteRule /faqlibraryan/.* /Support/FAQLibrary.asp [I,RP]
"The problem I am having is trying to 301 redirect old links (for example on our English site) to new URL on (the English site) and only redirect old links from the other domains (Spanish, Chinese, German) to the new URL on the English site."
- You should specify the proper RewriteCond Host: directive before EACH rule depending on the domain:
RewriteCond Host: www\.spanish\.es
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.spanish\.es
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.chinese\.cn
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /About/AboutUs\.html http\://www\.english\.com/About/AboutUs.asp [I,R]
RewriteCond Host: www\.german\.de
RewriteRule /faqlibraryan/.* http\://www\.english\.com/Support/FAQLibrary.asp [I,R]
RewriteCond Host: www\.english\.com
RewriteRule /About/AboutUs\.html /About/AboutUs.asp [I,RP]
RewriteCond Host: www\.english\.com
RewriteRule /faqlibraryan/.* /Support/FAQLibrary.asp [I,RP]
Re: Conditionally 301 or redirect based on domain it came fr
Thank you Anton. I really appreciate your quick response!
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests