如何在 robots.txt 中为特定的爬虫机器人分配特定的站点地图? [英] How to assign specific sitemaps for specific crawler-bots in robots.txt?

查看:49
本文介绍了如何在 robots.txt 中为特定的爬虫机器人分配特定的站点地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于有些爬虫不喜欢为 Google 制作的站点地图版本,因此我制作了不同的站点地图.

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

还有一个选择放

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

到robots.txt.但是可以这样说吗:

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

我找不到有关此主题的任何资源,而且 robots.txt 不是我想开玩笑的内容.

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

推荐答案

这在 robots.txt 中是不可能的.Sitemap: 值将由所有支持消费者使用.

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

Sitemaps.org 协议:

该指令独立于用户代理行,因此您将其放在文件中的哪个位置并不重要.

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

提到的替代方案:将站点地图提交给搜索引擎通过他们的网站通过 HTTP 请求.

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

这篇关于如何在 robots.txt 中为特定的爬虫机器人分配特定的站点地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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