Hi
I have this code that is supposed to redirect user according to his browser language but it doesn’t work.
[php]<?php
$lang = $_SERVER[‘HTTP_ACCEPT_LANGUAGE’];
switch($lang) {
case “de”:
case “ru”:
case “cn”:
case “fr”:
header(“Location: http://www.example.co.za/$lang/index.html”);
break;
default:
header(“Location: http://www.example.co.za/en/index.html”);
break;
}[/php]
When I use a Russian Firefox, I still get redirected to the “default” URL and not to the russian version as I should be. Furthermore, I did a test to echo out $_SERVER[‘HTTP_ACCEPT_LANGUAGE’]; and this is what was returned:
ru,en-us;q=0.7,en;q=0.3
Thanks in advance for any help.