I am planning to translate a static website into a few other languages. I am trying to figure out the best structure for doing this. I can think of 5 ways to do it. Example using Spanish:<p>1) es.example.com/index.html<p>2) www.example.es/index.html<p>3) www.example.com/es/index.html<p>4) www.example.com/index.html (with language set via a cookie)<p>5) www.example.com/index.html?lang=es<p>I see a problem with #2 already because TLDs are country specific not language specific. Also expensive.<p>I think #4 has a problem with regard to search engine optimizations as both languages would have the same canonical url. I would like my content to be indexed in both languages.<p>Wikipedia does #1. Apple does #3. Google does both #2 and #4.<p>Question 1) What structure would people here recommend?<p>Question 2) Would it be best to detect the browser's preferred language and auto-redirect people, or should I make the user do that language choice manually?
I think Apache web server supported setting Content-Language automatically and doing content negotiation based on Accept-Language (browser-set language) for static sites if you simply used index.es.html.<p>It's been a long time since I used this, so check the specifics.