要知道robots.txt如何设置之前,请称了解一下什么是robots.txt?
robots.txt写法:
robots.txt文件的内容主要包括2个代码:
User-Agent:
Disallow:
格式如:
User-agent: *
Disallow: /search.html
Disallow: /index.php?
Disallow: /tempweb/
说明:
User-agent: * 星号说明,允许所有的搜索引擎来收录,包括百度、google、yahoo等。
Disallow: /search.html 说明不允许收录 /search.html 这个文件。
Disallow: /index.php? 说明不允许收录以index.php?为前缀的链接如:index.php?122.html、index.php?=12、index.php?/baidu等等
Disallow: /tempweb/ 说明不允许收录/tempweb/里的所有文件。但可以收录如:/tempwebtaim.html 的链接
上述就是基本robots.txt设置写法,更多关于Disallow:的用法,你可以参见百度官方的介绍:http://www.baidu.com/search/robots.html
阅读本文的人还阅读:
你浏览的文章是 – 《robots.txt如何设置》!
作者:广西SEO深远 修订2.0 2009-12-20
原载:广西SEO
版权所有,转载请务必注明出处并保留作者链接,谢谢!
广西SEO第一品牌提供专业(SEO,SEM)网站优化服务!