apache 使用 .htaccess 抵擋有來自中國大陸的連線
中國大陸的廣告robot 真的很令人討厭,另管理者都要常常上網刪除廣告留言 有時還會被 spam robot 灌爆,於是乎就把所有大陸的連線設為拒絕往來戶 設定方式很簡單 請先將你的 apache 支援 htaccess 的功能打開 [root@station1 ~]# vim /etc/httpd/conf/httpd.conf Options FollowSymLinks #AllowOverride None # 註解取消 #AllowOverride Authconfig # 換為這行,認證整個網站都可以使用 AllowOverride All # 可以使用各種功能,不單單只有認證 # 重新啟動 apache [root@station1 ~]# /etc/init.d/httpd restart 接下來請在你的網頁目錄下建立一個 .htaccess 檔案,並且放入下面的內容 他會將 baidu 及所有來自於大陸的 ip 全部拒絕存取,可以省去很多麻煩. 他家的金盾工程為何不先做好這一段勒....!! SetEnvIf User-Agent ^Baidu baidu Deny from env=baidu order allow,deny deny from 58.14.0.0/15 deny from 58.16.0.0/16 deny from 58.17.0.0/17 deny from 58.17.128.0/17 deny from 58.18.0.0/16 deny from 58.19.0.0/16 deny from 58.20.0.0/16 deny from 58.21.0.0/16 deny from 58.22.0.0/15 deny from 58.24.0.0/15 deny from 58.30.0.0/15 deny from 58.32.0.0/13 deny from 58.40.0.0/15 deny from 58.42.0.0/16 deny from 58.43.0.0/16 deny from 58.44.0.0/14 deny from 58.48.0.0/13 deny from...