上海seo今日(2010-08-12)话题:什么是robots.txt?你给你的网站加robots.txt了吗?
什么是robots.txt?
robots.txt是搜索引擎中访问网站的时候要查看的第一个文件。robots.txt文件告诉蜘蛛程序在服务器上什么文件是可以被查看的,什么文件是不可以被看的。
如何给自己的网站书写robots.txt
最简单的robots.txt 文件使用的两条规则:
- User-Agent: 适用下列规则的漫游器
- Disallow: 要拦截的网页
| 禁止所有搜索引擎访问网站的任何部分 | User-agent: * |
| 允许所有的robot访问 | User-agent: * |
| 禁止spider访问特定目录 | User-agent: * Disallow: /bin/ Disallow: /tmp/ Disallow: /data/ |
| 允许访问特定目录中的部分url | User-agent: * Disallow: /bin/ Disallow: /tmp/ Disallow: /data/ |
使用robots.txt需注意:
文件名必须为小写,并且要放置在服务器的根目录里。
《什么是robots.txt》由上海seo发表,转载请标注www.cctv002.com。
