什么是robots文件
robots是站点与spider沟通的重要渠道,站点通过robots文件声明该网站中不想被搜索引擎收录的部分或者指定搜索引擎只收录特定的部分。请注意,仅当您的网站包含不希望被搜索引擎收录的内容时,才需要使用robots.txt文件。如果您希望搜索引擎收录网站上所有内容,请勿建立robots.txt文件。
禁止所有搜索引擎访问网站的任何部分(测试时使用)
User-agent: *
Disallow: /
允许所有的robot访问(上线后使用)
User-agent: *
Allow: /
禁止sprider访问特定目录(上线后使用)
User-agent: *
Disallow: /admin/
例
User-agent: *
Allow: /
Disallow: /admin/
Sitemap: http://www.creadeal.com/sitemap.xml
Sitemap: http://www.creadeal.com/sitemap.txt
原文:http://www.cnblogs.com/hunchun/p/6437427.html