Serving a page in English, EG:
https://www.example.com/en/make-games
Has the following meta tags:
<meta rel="alternate" href="https://www.example.com/fr/make-games" hreflang="fr" />
<meta rel="alternate" href="https://www.example.com/de/make-games" hreflang="de" />
<meta rel="alternate" href="https://www.example.com/zh/make-games" hreflang="zh" />
My issue is:
- When a new visitor visits the site, if no language tag is set (eg
https://www.example.com/make-games
it will make a guess as to which version of the site to server and 302 redirect them (eg to https://www.example.com/de/make-games) - It will then save a cookie on their computer saying their language is
de
(saves to their account if logged in etc) - Future requests where the cookie exists will automatically redirect to the
de
version
This concerns me from a crawling point of view, as if the crawler has the cookie set when crawling the site they will never be able to visit the alternative URLs, it will 302 redirect them back to the language they originally viewed.
What's the best way to handle this? One possible solution would be to have the alternative URLs along the lines of:
https://www.example.com/zh/make-games?forceLang=1
Which stops the auto redirect. Is this a reasonable solution?
Accept-Language
header and it does foreign language crawling from the US. Language redirects can be very problematic for bots, but not for the reasons you outlined above. – Stephen Ostermiller♦ Oct 2 '18 at 10:49forceLang
should be the default behavior for any URL that contains the language code. – Stephen Ostermiller♦ Oct 2 '18 at 10:52forceLang
in the URLs, however I do want to future proof it and allow other bots to be able to crawl that may allow cookies to be set. – Tom Gullen Oct 2 '18 at 14:37