robots.txt基本的用法

[标签:图片]robots.txt是一个纯文本文件,通过在这个文件中声明该网站中不想被robots访问的部分,这样,该网站的部分或全部内容就可以不被搜索引擎收录了,或者指定搜索引擎只收录指定的内容。

robots.txt必须放置在一个站点的根目录下,而且文件名必须全部小写。

下面是一些robots.txt基本的用法:

l 禁止所有搜索引擎访问网站的任何部分:
User-agent: *
Disallow: /

l 允许所有的robot访问
User-agent: *
Disallow:
或者也可以建一个空文件 “/robots.txt” file

l禁止所有搜索引擎访问网站的几个部分(下例中的cgi-bin、tmp、private目录)
User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /private/

l 禁止某个搜索引擎的访问(下例中的BadBot)
User-agent: BadBot
Disallow: /

l 只允许某个搜索引擎的访问(下例中的WebCrawler)
User-agent: WebCrawler
Disallow:

User-agent: *
Disallow: /

l 所有的搜索引擎抓取间隔设置(20意味着20秒):

User-agent:*

Disallow:

Crawl-delay:20

3、 常见搜索引擎机器人Robots名字

名称 搜索引擎

Baiduspider http://www.baidu.com

Scooter http://www.altavista.com

ia_archiver http://www.alexa.com

Googlebot http://www.google.com

FAST-WebCrawler http://www.alltheweb.com

Slurp http://www.inktomi.com

MSNBOT http://search.msn.com
更多精彩内容:访问 基本 部分 文件 所有 禁止 

最新评论

发表评论

为“robots.txt基本的用法”说几句吧

评论内容:发表评论不能请不要超过250字;发表评论请自觉遵守互联网相关政策法规。

关于我们 - 供应商加盟 - 人才招聘 - 版权声明 - 网站地图 - 友情链接

Copyright © 2009-2024 yr.pinnace.cn All Rights Reserved. 17育儿网 版权所有

粤ICP备11040004号-1