1-3 robots 內碼設定
robots.txt 是用來告訴搜尋引擎哪些地方不可以拿去做全文檢索資料庫。
robots.txt 樣本:
User-agent: {Spider名}
Disallow: {File位置}
設定方式很簡單:
- 使用 Notepad 來設定 robots.txt
- 上傳在網頁的root位置。
robots.txt範例如下:
- 設定所有 robot 不能夠收集 /upload/ 和 /download/ 目錄中的資料:
User-agent: *
Disallow: /upload/
Disallow: /download/
- 設定所有 robot 不能夠收集 index.htm 和 /work/index.html 中的資料:
User-agent: *
Disallow: /index.htm
Disallow: /work/index.html
- 設定所有 robot 不能夠收集所有網頁資料:
User-agent: *
Disallow: /
- 設定 Google Robot 不能夠收集 /upload/ 目錄中的資料:
User-agent: Googlebot
Disallow: /upload/
- 設定 Google Robot 和 Excite Spider 不能夠收集 /tmp/ 和 /index/work.html 目錄中的資料User-agent: Googlebot
User-agent: ArchitextSpider
Disallow: /tmp/
Disallow: /index/work.html
Robot對照表:
搜尋引擎 |
Robot 名稱 |
AltaVista |
Scooter |
Infoseek |
Infoseek |
Hotbot |
Slurp |
AOL Search |
Slurp |
Excite |
ArchitextSpider |
Google |
Googlebot |
Goto |
Slurp |
Lycos |
Lycos |
MSN |
Slurp |
Netscape |
Googlebot |
NorthernLight |
Gulliver |
WebCrawler |
ArchitextSpider |
Iwon |
Slurp |
Fast |
Fast |
DirectHit |
Grabber |
Yahoo Web Pages |
Yahoo Slurp |
Looksmart Web Pages |
Slurp |