I work on a website that has two languages: English and French.
- Pages available in English are under
/enin URL - Pages available in French are under
/frin URL
When a user arrives on the homepage, he is redirected to www.example.com/fr if its browser is in French, otherwise he is redirected to www.example.com/en.
Not all the pages are available in both languages, so there isn't any language redirection on other pages than root.
But I have few pages that I'd like to be redirected according to language. How can I redirect www.example.com/page to www.example.com/en/page (or www.example.com/fr/page)?
UPDATE: This is the code we use in .htaccess to redirect the home page:
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule ^/?$ /fr [R=302,L]
HTTP_HOSTnecessary? Do you host multiple domains on this account? - DocRoot