gpt4 book ai didi

asp.net - 建立多语言网站

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:46:40 25 4
gpt4 key购买 nike

我正计划建立一个新的多语言网站,并正在考虑它对 SEO 的影响。

当用户第一次访问该域时,会检测到他的语言设置,并根据此设置语言,他会被重定向到网站的适当语言版本并被 cookie 记录。如果在不同的 session 期间,该用户浏览该域,则会检测到 cookie,并将用户重定向到适当的国家/语言页面。同时,用户可以手动更改设置的语言(因此 cookie 也会更改)。

首先,如果我在主页上进行重定向(如果用户未使用 cookie),Google 会因此惩罚我吗?

其次,如果我将语言存储在文件夹中,例如www.mydomain.com/en-us/page.htmlwww.mydomain.com/cs-cz/page.html,Google 会抓取整个内容还是只抓取默认语言(意思是,如果我无法检测到该语言或我的网站没有该语言,我会选择英语)?

提前致谢,翁德赖

最佳答案

如果您有多语言内容,您应该关注 Google's new multi-lingual guidelines .基本上,您使用子域进行不同的翻译:

To explain how it works, let’s look at some example URLs: http://www.example.com/ - contains the general homepage of a website, in Spanish http://es-es.example.com/ - is the version for users in Spain, in Spanish http://es-mx.example.com/ - is the version for users in Mexico, in Spanish http://en.example.com/ - is the generic English language version On all of these pages, we could use the following markup to specify language and optionally the region:

<link rel="alternate" hreflang="es" href="http://www.example.com/" />
<link rel="alternate" hreflang="es-ES" href="http://es-es.example.com/" />
<link rel="alternate" hreflang="es-MX" href="http://es-mx.example.com/" />
<link rel="alternate" hreflang="en" href="http://en.example.com/" />

If you specify a regional subtag, we’ll assume that you want to target that region. Keep in mind that all of these annotations are to be used on a per-URL basis. You should take care to use the specific URL, not the homepage, for both of these link elements.

关于asp.net - 建立多语言网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9584611/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com