Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.