在网站根目录下还可以创建robots.txt文件,来引导搜索引擎收录网站。
Google蜘蛛 GoogleBot
BaiDu蜘蛛 Baiduspider
MSN蜘蛛 MSNBOT
robots.txt写作语法
允许所有的robot访问
User-agent: *
Disallow:
或者
User-agent: *
Allow:
或者也可以建一个空文件 "/robots.txt" file
禁止所有搜索引擎访问网站的任何部分
User-agent: *
Disallow: /
禁止所有搜索引擎访问网站的几个部分(下例中的01、02、03目录)
User-agent: *
Disallow: /01/
Disallow: /02/
Disallow: /03/
禁止某个搜索引擎的访问(下例中的BadBot)
User-agent: BadBot
Disallow: /
只允许某个搜索引擎的访问(下例中的Crawler)
User-agent: Crawler
Disallow:
User-agent: *
Disallow: /

本文介绍了如何通过robots.txt文件来控制搜索引擎对网站内容的抓取。包括允许或禁止特定搜索引擎访问整个站点或是某些目录的方法。
1049

被折叠的 条评论
为什么被折叠?



