Google 搜索在使用 Yii1 构建的多语言网站中不显示阿拉伯语主页搜索结果

Google search doesn't show Arabic home page search results in multilanguage website built with Yii1

我使用 Yii1 PHP 框架构建了一个多语言网站,它支持阿拉伯语和英语。站点中的每个 URL 都有一个形式:www.example.com/lang/(title_of_page OR something like slug for the articles/news)

除了英语和阿拉伯语的主页外,url:www.example.com。用户可以更改语言,因此网站的语言将更改,页面将以另一种语言重新加载,但它保持不变 url。

问题:Google 阿拉伯语搜索中没有出现阿拉伯语主页,但英语页面出现了。

我使用 xml-sitemap 在线工具从网站 URLs 制作了一个站点地图文件,但我发现无法抓取所有阿拉伯语 URLs。

出现此问题是因为我的每种语言的主页都相同 URL 还是其他原因?

我不是 SEO 高手,但这可能是网站语言依赖于 cookie 并且不知道 Google 喜欢它的原因。

搜索了一些官方信息,我发现 this link of Google 其中指出:

Keep the content for each language on separate URLs. Don’t use cookies to show translated versions of the page. Consider cross-linking each language version of a page. That way, a French user who lands on the German version of your page can get to the right language version with a single click.

所以答案很简单,在主页上更改语言时不要使用相同的 URL。我不知道你的网站,它的主要语言是什么,但我认为你应该使用 www.example.com URL 作为主要语言,使用 URL 为基础的辅助语言,例如 www.example.com/lang/