如果你希望搜索引擎收录你网站的全部网页,则你可以不设置robots.txt或上传一个命名为robots.txt的空记事本到根目录。
robots.txt文件的内容主要就是一个代码: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 的链接。