How to assign specific sitemaps for specific crawler-bots in robots.txt?

时光毁灭记忆、已成空白 提交于 2019-12-23 17:14:57

问题


Since some crawlers don't like the sitemap versions made for Google, I made different sitemaps.

And there is an option to put

Sitemap: http://example.com/sitemap.xml

to robots.txt. But is it possible to put it kinda like this:

User-agent: *
Sitemap: http://example.com/sitemap.xml

User-agent: googlebot
Sitemap: http://example.com/sitemap-for-google.xml

I couldn't find any resource for this topic and robots.txt is not something I want to joke around with.


回答1:


This is not possible in robots.txt. The Sitemap: value will be used by all supporting consumers.

Sitemaps.org protocol:

This directive is independent of the user-agent line, so it doesn't matter where you place it in your file.

Mentioned alternatives: submit the sitemaps to the search engines via their website or via HTTP requests.



来源:https://stackoverflow.com/questions/24973698/how-to-assign-specific-sitemaps-for-specific-crawler-bots-in-robots-txt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!