This is the problem, otherwise you're right to use the html5 tag
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$langConfig = array("en" => "english/", "it" => "italian/",
"de" => "deutsch/", "fr" => "french/",
"default" => "english/");
if(array_key_exists($lang, $langConfig)) {
$language = $langConfig[$lang];
} else {
$language = $langConfig['default'];
}
header('Location: ' . $language);