機車哩~~spider 也有這種來陰的,不照規定來的:有已寫好的 robots.txt 讓 spider 知道這兒歡不歡迎它們,但就有不看的傢伙存在
沒關係,上網 google 一下發現,還是有網友有法子可以治那些網路垃圾
有國外網友寫了這一篇資料:How to keep bad robots, spiders and web crawlers away
0.在使用這份資料之前,需先注意 apache2 是否有開啟支援 .htaccess
看 /etc/apache2/sites-available/default 設定檔,”None” 才是有開啟
AllowOverride None
作者提供了兩個方法供使用
1.使用 .htaccess 來限定 BOT 的行為
2.設 Robot trap (管他叫:網路爬虫用陷阱? robot抓取器? -.- 自行體會中文的意境~~)
紅使用了第二個『Robot trap』來抓 " robot 逃犯 "
下載網站提供的 robotrap.zip 檔,解壓縮後,上傳至 www根目錄(不含 robotrap目錄)
.htaccess , ailtrap.shtml , X.html
<DIR botsi> .htaccess , index.shtml
<DIR botsv> .htaccess , index.shtml
3.修改 /www根目錄/.htaccess 檔案內容
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^.*\.html /botsv/index.shtml
ErrorDocument 400 /botsv/index.shtml
ErrorDocument 402 /botsv/index.shtml
ErrorDocument 403 /botsv/index.shtml
ErrorDocument 404 /botsv/index.shtml
ErrorDocument 500 /botsv/index.shtml
4.設定好 .htaccess 後,一定要先測試原先網頁是否能正常運作
5.收工~等待驗收成果了..


![[婚禮紀錄] 2008.12.27 建文 & 美燕婚禮(圖多)](http://lh3.ggpht.com/_2l8BzEPgrEk/SWiss5pz0RI/AAAAAAAABmA/IjDc7wUcxro/s160-c/IMG_7423-01.jpg)

1. Comment by SIKO
24/十月/2007 at 12:56 上午
同樣不客氣的接收啦 ^^
By SIKO