多个站点地图:robots.txt 中的条目?
我一直在使用谷歌搜索,但找不到这个问题的答案。
robots.txt 文件可以包含以下行:
Sitemap: http://www.mysite.com/sitemapindex.xml
但是是否可以在 robots.txt 中指定多个站点地图索引文件,并使搜索引擎识别并抓取每个站点地图索引文件中引用的所有站点地图?例如,这是否有效:
Sitemap: http://www.mysite.com/sitemapindex1.xml
Sitemap: http://www.mysite.com/sitemapindex2.xml
Sitemap: http://www.mysite.com/sitemapindex3.xml
I have been searching around using Google but I can't find an answer to this question.
A robots.txt file can contain the following line:
Sitemap: http://www.mysite.com/sitemapindex.xml
but is it possible to specify multiple sitemap index files in the robots.txt and have the search engines recognize that and crawl ALL of the sitemaps referenced in each sitemap index file? For example, will this work:
Sitemap: http://www.mysite.com/sitemapindex1.xml
Sitemap: http://www.mysite.com/sitemapindex2.xml
Sitemap: http://www.mysite.com/sitemapindex3.xml
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,可以有多个站点地图索引文件:
由我突出显示。
是的,可以在
robots.txt
中列出多个站点地图文件,另请参阅在 sitemap.org 网站中:我强调一下,这不能误读我想说的,所以简单地说,这是可以做到的。
这对于交叉提交也是必要的,顺便说一句。已选择
robots.txt
。顺便说一句,Google、Yahoo 和Bing,全部是 sitemaps.org 的成员:
因此,您可以放心,搜索引擎机器人将正确读取您的站点地图条目。
通过网站管理员工具提交它们也不会造成任何伤害 - 正如 John Mueller 评论了。
Yes it is possible to have more than one sitemap-index-file:
Highlight by me.
Yes it is possible to list multiple sitemap-files within
robots.txt
, see as well in the sitemap.org site:Highlight by me, this can not be misread I'd say, so simply spoken, this can be done.
This is also necessary for cross-submits, for which btw. the
robots.txt
has been chosen.Btw Google, Yahoo and Bing, all are members of sitemaps.org:
So you can rest assured that your sitemap entries will be properly read by the search engine bots.
Submitting them via webmaster tools can not hurt either - as John Mueller commented.
如果您的站点地图超过 10 MB(未压缩)或包含超过 50,000 个条目,Google 要求您使用与站点地图索引文件捆绑在一起的多个站点地图。
在您的 robots.txt 中指向站点地图索引应该如下所示:
If your sitemap is over 10 MB (uncompressed) or has more than 50 000 entries Google requires that you use multiple sitemaps bundled with a Sitemap Index File.
In your robots.txt point to a sitemap index which should look like this:
建议创建站点地图索引文件,而不是将单独的 XML URL 放入 robots.txt 文件中。
然后,将索引站点地图 URL 放入 robots.txt 文件中,如下所示。
如果您想了解如何创建索引站点地图网址,请按照来自 sitemap.org 的指南
最佳实践:
仅将 robots.txt 文件直接放在根目录中。
It's recommended to create a sitemap index file, rather separate XML URLs to put in your your robots.txt file.
Then, put the indexed sitemap URL as below in your robots.txt file.
If you want to learn how to create indexed sitemap URL, then follow this guide from sitemap.org
Best Practice:
Put robots.txt file in root directly only.
您需要在文件
sitemap.xml
中指定此代码:来源:https://support.google.com/webmasters/answer/75712?hl=fr#
You need specify in your in your file
sitemap.xml
this code:source: https://support.google.com/webmasters/answer/75712?hl=fr#
可以编写它们,但由搜索引擎决定如何处理它们。我怀疑许多搜索引擎要么“不断消化”越来越多的标记,要么将他们找到的最后一个站点地图作为真实的站点地图。
我建议问题是“如果我想要 ____ 搜索引擎索引我的网站,我是否能够定义多个站点地图?”
It is possible to write them, but it is up to the search engine to know what to do with it. I suspect many search engines will either "keep digesting" more and more tokens, or alternatively, take the last sitemap they find as the real one.
I propose that the question be "if I want ____ search engine to index my site, would I be able to define multiple sitemaps?"