Cambiar a subdominio según el idioma del navegador

<?php
    // Initialize the language code variable
$lc = ""; 
    // Check to see that the global language server variable isset()
    // If it is set, we cut the first two characters from that string
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
    $lc = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

    // Now we simply evaluate that variable to detect specific languages
if($lc == "fr"){
    header("location: index_french.php");
    exit();
} else if($lc == "de"){
    header("location: index_german.php");
    exit();
}
else{ // don't forget the default case if $lc is empty
    header("location: index_english.php");
    exit();
}
?>

¡Este código hace su trabajo perfectamente! Solo surge un problema. No hay forma de cambiar el idioma, incluso con enlaces directos a otro idioma porque tan pronto como se cargaba la página, el bloque php redirige al idioma del navegador.

Entonces, mi solución para este problema fue crear carpetas con una versión duplicada para cada idioma (incluso la del idioma principal) sin este código php en index.html (y, por lo tanto, no index.php).

¡Así que ahora mi sitio web detecta automáticamente el idioma y el usuario también tiene la opción de cambiarlo manualmente en caso de que lo desee!