Language redirect using .htaccess

I have two versions of the same page:

  • -> French version

I would like French people who access to to be redirected to based on the header Accept-language. To do that I wrote this into my .htaccess:

RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ [L,R=301]

I works perfect so far.

But in my site there are links to the French / English versions… When a French user who is in the French version clicks on the english link, he comes back to the french version… How can I avoid this? How can I distinguish he actually wants to go to the English version?

Source: .htaccess

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.