Is there a way to redirect an user depending on is browser locale ?
For instance, I'd like to redirect to a page called index.en.html all users who doesn't have their browser locale set to French.
Could I do this with Apache and .htaccess ?
Is there a way to redirect an user depending on is browser locale ?
For instance, I'd like to redirect to a page called index.en.html all users who doesn't have their browser locale set to French.
Could I do this with Apache and .htaccess ?
Well looking at the documentation I found the MultiViews option.
You should be able to match the environment variable
%{HTTP_ACCEPT_LANGUAGE}
or the HTTP headerAccept-Language
(with%{HTTP:Accept-Language}
) forfr
orfr-fr
.You can use
mod_rewrite
and test for theAccept-Language
header. For example:Better yet, take a look at
mod_negotiation
http://httpd.apache.org/docs/2.2/content-negotiation.html