1
What is the correct method to direct a site’s navigation to a specific page based on the user’s browser language?
I have a website (www.site.com) with the default language in English and I need that, when accessed in a browser with the Portuguese language (en), it redirects navigation to the subdomain I created and already hosted the translated files (br.site.com).
The same for Spanish (es.site.com) and Italian (it.site.com).
What should I do? What kind of code should I enter?
PS: I already have the pages translated and hosted in the respective subdomains. I just need to know how to identify the browser language and direct automatically.
How is this done in code? Javascript? PHP? Ajax? Via htacess? Someone has this line of code to share?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My site</title>
</head>
<body>
<p>The book is on the table.</p>
</body>
</html>
http://answall.com/questions/81073/how-pega-o-idioma-do-usu%C3%A1rio-do-navegador
– Italo Rodrigo