2

My website is localized in three languages: en, de, fr. The language versions are appended to the URL as folders (e.g. website.com/en/, website.com/de/, website.com/en/contact/, etc). The root page (website.com) has a server-side PHP redirect (302) based on HTTP_ACCEPT_LANGUAGE to one of these language versions, with a fallback to /en/.

hreflang attributes are set correctly, the root page has no hreflang or canonical tags because it does a header redirect before it renders any HTML.

Everything works as expected, just the google index seems to index the root page instead of /en/, because it sees it as a duplicate of /en/, as the google bot with an English user agent is always redirected to /en/. Google prefers the root page (with the redirect) instead of /en/ and therefore excludes /en/ from the index. Is there something I can do to make it index /en/ instead of /?

The pages I want in the Google index are:

  • /en/
  • /de/
  • /fr/

The root page should not be in the index, as it redirects to the correct language for the user, but Google thinks it's the same as /en/. Right now English Google results show the root page.

3

Instead of using a fallback to English, create a simple page that lets the user choose their language. It can be very bare, saying little more than:

Deutsch | English | Français

This page can also use the x-default hreflang.

That way Googlebot won't see the root page as being the same as the English home page. Googlebot will have links to all the languages, so your crawling and SEO will be better. Any users that don't have their browsers configured for one of your three supported languages will get a choice rather than being automatically redirected to a language that they might not actually prefer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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