:: 設為首頁 :: 加到我的最愛 ::
2008 年 05 月 13 日 (星期二) 11:41
hkwebs.net
用戶名稱 >     密碼 >    
忘記密碼   會員注冊
 
公 司 列 表
網 頁 寄 存
主 機 租 用
主 機 托 管
電 郵 服 務
域 名 服 務
服 務 搜 尋
服 務 排 名
名 詞 解 釋
免 費 資 源
網 頁 教 學
下 載 區
討 論 區
Google
  Thunderbird
Mozilla
GameServer.hk 香港遊戲討論區。
電子咖啡室
香港傳遞訊息
LOVELAND
 
加入

hkwebs 網頁教學 設定 robots.txt

 
主題: 設定 robots.txt
工具: Notepad
實例: 本站的 robots.txt

內容:

robots.txt 是用來告訴搜尋引擎哪些地方不可以拿去做全文檢索資料庫。

資源自動收集 (Robot) 是搜尋引擎中負責資料收集的軟體,又稱為 Spider、或Crawler。他可以自動在設定的期限內定時自各網站收集網頁資料,而且通常是由一些預定的起始網站開始遊歷其所連結的網站,如此反覆不斷 (recursive) 的串連收集。
 


步驟:

  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

 


如有對以上教學有任何疑問,請到討論區發問。

 
Copyright © 2003-2004
hkwebs.net All Right Reserved.