3

let's assume we have a domain example.com that contains content for two languages (e.g. German and English).

The site itself is structured by folders, so the URLs for the language versions are:

  • example.com/de/ -> German Page
  • example.com/en/ -> English Page

If someone now enters example.com in the browser I do not want to show a "select language page" that lets the user choose the language but an automatic detection of the browser language to redirect (301) to /de/ for German users and to /en/ for all others.

That is nothing special so far.

But I fear that search engines like Google will have problems indexing the url example.com. So instead of doing the automatic redirect (302) on that page, what about the following idea:

example.com does a 301 to example.com/en/ in any case and on the page example.com/en/ the language of the user is then detected. If the language is "German", another redirect (301) to example.com/de/ is made. Otherwise, nothing is done. One could even think about checking the referrer on example.com/en/ if it comes from example.com and only in that case, probe for the German language of the user. The advantage of that would be that a German user could actively switch to example.com/en/ without triggering another redirect back to the German version.

Is such as method for redirecting in a multi language page a good idea in regards to SEO terms?

2 Answers 2

2

Google doesn't index pages that redirect. If your domain home URL just has auto-detect redirect or "choose language" functionality, it isn't going to get indexed. But that is fine. You want your language sub-pages indexed in place of your domain home URL.

The best practice in a case like this is:

  • Auto redirect from the home URL when a language preference can be determined either from the Accept-Language header or from geographically locating the IP address.
  • If the language cannot be automatically determined on the home URL, show a menu that lets users select their language. In many cases bots don't have a preferred language set, so this menu lets bots easily find and crawl all your languages.
  • NEVER auto-redirect from URLs for a specific language. example.com/de/ should never automatically redirect to example.com/en/ or the other way around. Any automatic language detection is imperfect and it is important to allow users to make language decisions on their own. At the most you could put a prominent notice on the page saying "Click here for the English version of this page."
  • Use hreflang tags in every page that is available in multiple languages to tell search engines about the others.
  • Provide a language selection widget on every page for users. It is common to put it in the header or the footer.

For more info see How should I structure my URLs for both SEO and localization?

4
  • "[...] automatic language detection is imperfect and it is important to allow users to make language decisions on their own [...]" +1. I might be in Germany using a computer with a keyboard set to German language, using an OS set to German language, and using a browser set to German language. And I can read German. Great. But if I'm pressed for time, then, given the option, I'd like the English-language version please. There's no way the website can automatically detect my preference and if it attempts to guess (on the evidence available) it's almost certainly going to get it wrong.
    – Rounin
    Jun 28, 2021 at 14:21
  • @Rounin right. Plus you have issues of international travel, using a computer as a guest, browsers that default to "English", and crawlers that need to access all content in all languages. Jun 28, 2021 at 15:17
  • Hi @StephenOstermiller, were you able to solve this? I'm facing the same issue, the .com just makes a 302 redirect to /en /fr /es, etc, but not sure if this 302 redirect is the best way..
    – mauriblint
    Mar 20 at 17:04
  • The correct tag name is hreflang, not href-lang. See developers.google.com/search/docs/specialty/international/…
    – emkey08
    Apr 30 at 5:57
0

Managing multi-regional and multilingual sites https://developers.google.com/search/docs/advanced/crawling/managing-multi-regional-sites

Methods for indicating your alternate pages https://developers.google.com/search/docs/advanced/crawling/localized-versions?hl=nl#methods-for-indicating-your-alternate-pages

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.