發現google實在強了,他不只可以讓你網站曝光,如果你上傳一些重要的檔案放在網路上,只要沒有經過帳號密碼的機制,讓google知道你的絕對路徑,那個檔案就完蛋了,因為google還會暫存到他的機器,順便還幫你轉成 html ,夠屌了吧,所以我認為唯一最終解決辦法,就是自己寫一隻下載檔案的function,然後下載檔案都要透過該程式然後在header出來,這樣才不會被google弄到檔案,囧。
當然要如何擋掉搜尋引擎,方法如下,在自己網站底下新增 .htaccess
#擋掉百度
SetEnvIfNoCase User-Agent "^Baidu" bad_bot
SetEnvIfNoCase User-Agent "^sogou" bad_bot
SetEnvIfNoCase User-Agent "^Bloghoo" bad_bot
SetEnvIfNoCase User-Agent "^Scooter" bad_bot
Deny from env=bad_bot
#擋掉google
SetEnvIf User-Agent "^Googlebot" google
Deny from env=google
其實還有另外一種方法,那就是用 robots.txt 如何攔截 Googlebot?,這個方法也不錯
擋掉的結果如下:
66.249.70.107 - - [20/Jun/2007:15:30:11 +0800] "GET /store/market_list.php??bid=&year=2009&month=10 HTTP/1.1" <font color='red'>403</font> 999 "-" "Mozilla/5.0 (compatible; <font color='red'>Googlebot</font>/2.1; +http://www.google.com/bot.html)"
<br />
61.135.162.53 - - [20/Jun/2007:14:41:00 +0800] "GET /web/news_show.php?bid=30&newsid=189&list= HTTP/1.1" <font color='red'>403</font> 1003 "-" "<font [...]
