Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are about to deploy a new internal website (new domain and all) and we would like to have existing user bookmarks still function. The catch is we have a bilingual website.

The old domain:

english: http://olddomain/route/to/some/post
french:  http://olddomain/fr/route/to/some/french/post

The new domains:

english: http://new-domain-en/route/to/some/post
french:  http://new-domain-fr/route/to/some/french/post

So right now, I have these two htaccess rules:

RewriteRule ^fr/(.*)$ http://new-domain-fr/$1 [R=301,L]
RewriteRule ^(.*)$ http://new-domain-en/$1 [R=301,L]

Which would make anyone who visits new-domain-fr get redirected to the english website. The problem is both new domains point to the same server (and thus, the same htaccess file), and then wordpress will server the correct content from there.

Can this all be done via htaccess or should I write a php script to interpret URLs and route appropriately?

share|improve this question
up vote 2 down vote accepted

Point olddomain to a new virtual host, or put the rewrite rules in the domain configuration instead of the .htaccess file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.