4

I'd like to get rid of multilingual stuff in URLs, i.e. to get site.com/page instead of en.site.com/page, site.com/en/page, and site.com/page?lang=en.

The motivation is: humans don't need the stuff. One can get page?lang=de link by searching some German phrase or browsing some German-speaking community. What Accept Language does he/she have? So, SE is the only party, which needs messy URLs because of poor (lack of) Accept Language support. Search engines try to understand all languages, while humans do know which one they need. I'd like to keep messy URLs for crawlers only, and to show clean ones to humans whenever possible.

Questions:

  1. What's wrong with my motivation?
  2. There's no way to substitute messy URLs by clean ones in search results, isn't it?
  3. Do SEs take window.location into account? Is it dangerous to clean URL bar via JS?
  4. Unlike Google that allows to link localizations together via sitemap, Yandex wants <link rel="alternate" hreflang="... to be inside pages' code. Do I need to synchronize these tags with window.location?
1
  • 1
    From what I've realised, users don't have their browser language properly configured. Sometimes their home computer is OK, but maybe not their work, university, or hotel computers. It's a good practice to include /language/ segments in the URL. I personally don't see it as an inconvenience and I thinks most users do not see it as a problem as well.
    – Osvaldo
    Apr 10, 2017 at 19:04

1 Answer 1

3

There is nothing wrong with your desire to clean the URL's up a but per-sey, however I will point out a few things here...

  • Users are generally accepting of having a language code in the URL (either as a sub domain or as a directory of the main domain).
  • You are correct that it is best not to have the language code as a URL parameter as that can easily be changed or forgotten.
  • Many users don't have the Accept Language settings in their browser set right, either due to not having control over it (public or business computer) or not understanding how to do it.

Common practice, which is also one of the supported options by Google, is to either use sub domains for your language codes or to use country-code top level domains (more expensive as you need to purchase a domain name for each translation of your website). You also include the rel="alternate" href-lang="..." meta in your files to link to the translated version. Something I also do is check the headers to see if the Accept Language header is there and is something other that the default site language in which case I present the user with an option in their language to go to the translated site instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.