我的问题是
<link rel="alternate" href="http://example.com/en" hreflang="en">
<link rel="alternate" href="http://example.com/it" hreflang="it">
应该像上面的所有页面一样,或者应该用每个页面的实际 url 进行更改,例如:
<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">
HTML5 defines http://www.w3.org/TR/2014/REC-html5-20141028/links.html#rel-alternate:
If the alternate
关键字与hreflang
属性,并且该属性的值与根元素的语言不同,则表明引用的文档是翻译。
所以这是为了翻译文件(即页面),而不是网站。
http://example.com/en
链接到http://example.com/it
,
http://example.com/en/hello
链接到http://example.com/it/ciao
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)