【问题标题】:How the hreflang is supposed to be built?hreflang 应该如何构建?
【发布时间】:2015-07-06 14:06:48
【问题描述】:

我的问题是

<link rel="alternate" href="http://example.com/en" hreflang="en">
<link rel="alternate" href="http://example.com/it" hreflang="it">

应该像上面所有页面一样,或者应该使用每个页面的实际网址进行更改,例如:

<link rel="alternate" href="http://example.com/en/<?=$current;?>" hreflang="en">
<link rel="alternate" href="http://example.com/it/<?=$current;?>" hreflang="it">
<link rel="alternate" href="http://example.com/<?=$current;?>" hreflang="x-default">

【问题讨论】:

  • Google 阅读常见错误 -> 示例 hreflang 配置:注释在行动。

标签: php html seo multilingual rel


【解决方案1】:

HTML5defines:

如果alternate 关键字与hreflang 属性一起使用,并且该属性的值与根元素的语言不同,则表明引用的文档是翻译。

所以它适用于翻译后的文档(即页面),而不是网站。

http://example.com/en 链接到http://example.com/it
http://example.com/en/hello 链接到http://example.com/it/ciao

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-24
    • 2018-07-17
    • 1970-01-01
    • 1970-01-01
    • 2018-10-27
    • 2015-09-23
    • 1970-01-01
    相关资源
    最近更新 更多