使用 Schema.org,我可以为我的网站设置名称,以便它在 Google 搜索中可见:https://developers.google.com/structured-data/site-name
例子:
<script type="application/ld+json">
{ "@context" : "http://schema.org",
"@type" : "WebSite",
"name" : "Your WebSite Name",
"alternateName" : "An alternative name for your WebSite",
"url" : "http://www.your-site.com"
}
</script>
如果我有多语言网站怎么办? 5 种语言 → 5 个索引页,例如:http://www.example.com/en/
不同网站名称的每种语言设置不同的URL是否正确?我找不到任何相关文档。
最佳答案
是否使用不同的路径(…/en/
+ …/de/
),不同的子域(en.example.com
+ de.example.com
) 或不同的域 (example.com
+ example.net
),您有不同的(尽管已翻译)网站。
所以使用一个单独的WebSite
您的每个网站的项目。
示例(使用 RDFa)
在 http://example.com/en/
上,您可以指定:
<head typeof="schema:WebSite">
<title property="schema:name">Example</title>
<link property="schema:url" rel="canonical" href="http://example.com/en/" />
</head>
在 http://example.com/de/
上,您可以指定:
<head typeof="schema:WebSite">
<title property="schema:name">Beispiel</title>
<link property="schema:url" rel="canonical" href="http://example.com/de/" />
</head>
关于html - 多语言网站的 Google 搜索结果中的网站名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30461362/