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

Redirect to canonical URL gives hreflang error in Google Webmaster Tools

· 52CE 我爱测

In my website the root page https://www.amolelingue.com/ has 301 redirect to canonical English URL https://www.amolelingue.com/en , which has two alternate versions (/it and /fi). I'm getting following two errors in International…

问题原文

原帖链接 · Markus Laire · CC BY-SA 3.0

In my website the root page https://www.amolelingue.com/ has 301 redirect to canonical English URL https://www.amolelingue.com/en, which has two alternate versions (/it and /fi).

I'm getting following two errors in International Targeting of Search Console of Google Webmaster Tools:

Each of the three pages (/en /it /fi) lists itself as canonical version and also has hreflang-links to all three pages. For example English version has:

<link rel='canonical' href='https://www.amolelingue.com/en'>
<link rel='alternate' href='https://www.amolelingue.com/en' hreflang='en'>
<link rel='alternate' href='https://www.amolelingue.com/it' hreflang='it'>
<link rel='alternate' href='https://www.amolelingue.com/fi' hreflang='fi'>

Nowhere do I mention "/" as canonical URL, so why am I getting errors about it not having return tags? Have I done some error here or is Google Webmaster Tools reporting this incorrectly?

已采纳解答

原帖链接 · GDVS · CC BY-SA 3.0

Your configuration is incorrect. Rather than permanently redirect the root to https://www.amolelingue.com/en.

Either:

  1. Do a conditional redirect, i.e. test the user's browser language and do a temporary redirect to the appropriate language page, /en, /it or /fi.
  2. Don't redirect the root at all, and have a page on which users can select the version they want.

Then identify the root with "x-default" as follows:

<link rel="alternate" href="https://www.amolelingue.com/en" hreflang="en">
<link rel="alternate" href="https://www.amolelingue.com/it" hreflang="it">
<link rel="alternate" href="https://www.amolelingue.com/fi" hreflang="fi">
<link rel="alternate" href="https://www.amolelingue.com/" hreflang="x-default">

Google's documentation on hreflang is here, and the relevant part is:

[…] the reserved value "x-default" is used for indicating language selectors/redirectors which are not specific to one language or region, e.g. your homepage showing a clickable map of the world.

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

资料来源与适用范围

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

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

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