租用虛擬主機最擔心的就是流量浪費,
若是一堆搜尋引擎的機器人在網站內逛來逛去,
很容易浪費流量,
故可以用一些方法來避免。
![]()
原文在此
User-agent: *
Disallow: /
步驟:
1.使用 Notepad 來設定 robots.txt
2.上載在網頁的最底部。
編碼:
robots.txt 樣本:
User-agent: {Spider名}
Disallow: {File位置}
例:設定所有 robot 不能夠收集 /tmp/ 和 /download/ 目錄中的資料。
User-agent: *
Disallow: /tmp/
Disallow: /download/
例:設定所有 robot 不能夠收集 etc.htm 和 /index/work.html 中的資料。
User-agent: *
Disallow: /etc.htm
Disallow: /index/work.html
例:設定所有 robot 不能夠收集所有網頁資料。
User-agent: *
Disallow: /
例:設定 Google 不能夠收集 /tmp/ 目錄中的資料。
User-agent: Googlebot
Disallow: /tmp/
例:設定 Google 和 Excite 不能夠收集 /tmp/ 和 /index/work.html 目錄中的資料。
User-agent: Googlebot
User-agent: ArchitextSpider
Disallow: /tmp/
Disallow: /index/work.html
對應表:
| 搜尋引擎 |
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 |
Googlebot |
| Looksmart Web Pages |
Slurp |