: Clean URLs at multilingual single-page site 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
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:
What's wrong with my motivation?
There's no way to substitute messy URLs by clean ones in search results, isn't it?
Do SEs take window.location into account? Is it dangerous to clean URL bar via JS?
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?
More posts by @Welton855
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.