htaccess 301 - special case, 2 domains, 2 languages, same site

3 replies
Hi all,

I'm having a headache trying to do a 301 for a very special case...

I've just made the English translation of my main French website. For this, I have bought a new English domain. This is a Joomla site with SEF URLs enabled, which means the URLs all look like this:

Code:
http://www.frenchdomain.fr/fr/some-content-in-french
http://www.frenchdomain.fr/en/some-content-in-english
and of course the same goes for the English domain. Both resolve to the same website. Both work just fine. The only problem is, Google is going to index both!

So what I'd like to do is this:

Code:
http://www.frenchdomain.fr/en/* redirects to http://www.englishdomain.com/en/
http://www.englishdomain.com/fr/* redirects to http://www.frenchdomain.fr/fr/
I've read several 301 tutorials and I've also made simple 301s in the past (when changing of domain completely), but none of the websites I've looked at mentions a similar case. So I'm open to suggestions!

Thanks.

Seb.

Ps: I've tried this to no avail:

Code:
RewriteRule http://www.frenchdomain.fr/en/(.*) http://www.englishdomain.com/en/$1 [R=301,L] 
RewriteRule http://www.englishdomain.com/fr/(.*) http://www.frenchdomain.fr/fr/$1 [R=301,L]
#301 #case #domains #htaccess #languages #site #special

Trending Topics