Page 275 - HTTP权威指南
P. 275
# Keep Suzy's robot out of all the dynamic URLs because it doesn't
# understand them, and out of all the private data, except for the
# small section Mary has reserved on the site for Suzy.
User-Agent: Suzy-Spider
Disallow: /dynamic
Allow: /private/suzy-stuff
Disallow: /private
# The Furniture-Finder robot was specially designed to understand
# Mary's antique store's furniture inventory program, so let it
# crawl that resource, but keep it out of all the other dynamic
# resources and out of all the private data.
User-Agent: Furniture-Finder
Allow: /dynamic/check-inventory
Disallow: /dynamic
Disallow: /private
# Keep everyone else out of the dynamic gateways and private data.
User-Agent: *
Disallow: /dynamic
Disallow: /private
这个 robots.txt 文件中包含了一条机器人 SuzySpider 的记录,一条机器人 FurnitureFinder
的记录,以及一条用于所有其他机器人的默认记录。每条记录都对不同的机器人使
用了一组不同的访问策略。
• SuzySpider 的排斥记录不允许机器人爬行以 /dynamic 开头的商店库存网关 URL,
以及在为 Suzy 保留的区域之外的其他私有用户数据。
236 • FurnitureFinder 机器人的记录允许机器人爬行家具库存网关 URL。这个机器人可
能能够理解 Mary 的网关格式和规则。
• 其他机器人都不能访问所有的动态和私有 Web 页面,但它们可以爬行其余的
URL。
表 9-4 列出了几个机器人实例,这几个机器人具有不同的 Mary 古董网站访问权限。
表9-4 Mary古董网站的机器人访问权限
URL SuzySpider FurnitureFinder NosyBot
http://www.marys-antiques.com/ √ √ √
http://www.marys-antiques.com/index.html √ √ √
248 | 第 9 章