多语言网站的站点地图应该有多详细? [英] How detailed should my sitemap be for a multilingual site?

查看:146
本文介绍了多语言网站的站点地图应该有多详细?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单页网站,其中包括英语主页和法语主页.一个人可以通过以下URL访问我的网站:

I have a one page website which includes an English main page, and a French Main Page. One can access my website through the following URLs:

主页的英语版本

  • www.example.org
  • www.example.org/index.html
  • example.org
  • example.org/index.html
  • www.example.org
  • www.example.org/index.html
  • example.org
  • example.org/index.html

主页面的法语版本

  • www.example.org/fr
  • www.example.org/fr/index.html
  • example.org/fr
  • example.org/fr/index.html
  • www.example.org/fr
  • www.example.org/fr/index.html
  • example.org/fr
  • example.org/fr/index.html

为了实现最佳搜索引擎索引编制,我是否应该在站点地图中同时包含所有这些URL(同时包含http://https://)?如果没有,应该在我的sitemap.xml文件中包括哪些URL?

For optimal search engine indexing, should I include all of these URLs in my sitemap (with both http:// and https://)? If not, what would be the set of URLs I should include in my sitemap.xml file?

推荐答案

最佳做法是每个文档具有一个规范的URL .并且每个规范网址都应添加到您的站点地图中(如果有的话).

The best practice is to have one canonical URL per document. And each canonical URL should be added to your sitemap (if you have one).

因此,在您的情况下,您可能要使用一个URL用作英语主页,并使用一个URL用作法语主页,然后重定向(通过 canonical链接关系声明规范URL.

So in your case you may want to use one URL for the English main page and one URL for the French main page, and redirect (with HTTP status code 301) from the other URLs to the canonical ones. In addition, you can declare the canonical URL with the canonical link relation.

如果除了HTTPS之外还需要提供HTTP(而不是强制HTTPS),则每个文档当然需要具有两个URL(一个HTTP,一个HTTPS).但是您应该只在站点地图中列出一个变体,并且您只应将一个声明为canonical(最好与您添加到站点地图中的相同).

If you need to provide HTTP in addition to HTTPS (instead of enforcing HTTPS), you would of course need to have two URLs per document (one with HTTP, one with HTTPS). But you should only list one variant in the sitemap, and you should only declare one as canonical (ideally the same which you added to the sitemap).

选择哪个URL可能取决于多种因素(可用性,SEO,您的后端等),但是可以肯定地假设index.html是镇流器.您必须决定是否使用www子域(通用约定).假设您选择忽略它,则可以使用以下规范的URL:

Which URLs to choose can depend on various factors (usability, SEO, your backend, …), but it seems safe to assume that index.html is ballast. You’d have to decide if to use the www subdomain (a common convention) or not. Assuming that you choose to omit it, you could have these canonical URLs:

https://example.org/

https://example.org/fr

您将使用301将以下URL重定向到上面列出的规范URL:

And you would redirect the following URLs with 301 to the canonical URLs listed above:

https://example.org/index.html
https://www.example.org/
https://www.example.org/index.html

https://example.org/fr/index.html
https://www.example.org/fr
https://www.example.org/fr/index.html

这篇关于多语言网站的站点地图应该有多详细?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆