Reputation: 201
I have a joomla website in french and german. I can switch from one to the other with url param lang=fr or lang=de
I would like to switch the domain name depending on the url param.
if lang=fr
rewrite www.frenchdomainname.ch/old_params
if lang=de
rewrite www.germandomainname.ch/old_params
Is there a way to do it from with htaccess redirect?
Upvotes: 1
Views: 67
Reputation: 143906
Try:
RewriteEngine On
RewriteCond %{HTTP_HOST} !frenchdomainname\.ch [NC]
RewriteCond %{QUERY_STRING} ^(.*)lang=fr&?(.*)$
RewriteRule ^(.*)$ http://www.frenchdomainname.ch/$1?%1%2 [L,R]
RewriteCond %{HTTP_HOST} !germandomainname\.ch [NC]
RewriteCond %{QUERY_STRING} ^(.*)lang=de&?(.*)$
RewriteRule ^(.*)$ http://www.germandomainname.ch/$1?%1%2 [L,R]
Upvotes: 1