Redirect by Language using PHP

<?php
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
switch ($lang){
    case "tr":
        header('Location: http://tr.com');
        break;
    default:
        header('Location: http://en.com');
        break;
}
?>
Advertisements