Forum Moderators: phranque

Message Too Old, No Replies

301 redirect - multilanguage websites

301 redirect - multilanguage websites

         

liborson

4:37 pm on Jul 30, 2007 (gmt 0)

10+ Year Member



Hello,
while I am familiar with 301 redirect of the old/other domain to the new one using regular expressions (which I learn by examples posted here), I do have a different problem to be solved.

How do I redirect domain.DE to domain.COM/deutsch.html using regular expressions?

This is how it works now:
RewriteCond %{HTTP_HOST} ^domain\.de$ [NC]
RewriteRule ^(.*)$ [domain.com...] [L,R=301]

I need it mostly for the marketing purposes (promoting .DE domain to German market and redirecting to .COM domain with German content at /deutsch.html then).

Any help is appreciated.

jdMorgan

3:19 pm on Jul 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> How do I redirect domain.DE to domain.COM/deutsch.html using regular expressions?

By adding "/deutsch.html" to the substitution URL:


RewriteCond %{HTTP_HOST} ^(www\.)?domain\.de(:[0-9]+)?$ [NC]
RewriteRule (.*) http://www.domain.com/deutsch.html [R=301,L]

Other changes to properly handle optional port numbers on the end-anchored hostname, allow for "www." subdomain, and remove unnecessary regex tokens.

Jim

liborson

7:38 am on Aug 1, 2007 (gmt 0)

10+ Year Member



Working great! Thank you very much!