大网数据广告活动
网站运营与故障问答

Multi-Language Website Language Redirect Google Index Compatibility

· 52CE 我爱测

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…

问题原文

原帖链接 · Marcel · CC BY-SA 4.0

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.

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。