觸屏版
全國(guó)服務(wù)熱線:0571-87205688
登錄
注冊(cè)
客戶中心
關(guān)注云客
最近碰到幾個(gè)流氓IP,一天掃描網(wǎng)站達(dá)幾萬(wàn)次,恐怖!如果你是虛擬主機(jī)這個(gè)就非常實(shí)用了!
注:根據(jù)需求修改(8.8.4.4|8.8.8.)ip范圍,替換掉你要屏蔽的IP
Linux下 規(guī)則文件.htaccess(手工創(chuàng)建.htaccess文件到站點(diǎn)根目錄)
<IfModule mod_rewrite.c>
RewriteEngine On
#Block ip
RewriteCond %{http:X-Forwarded-For}&%{REMOTE_ADDR} (8.8.4.4|8.8.8.) [NC]
RewriteRule (.*) - [F]
</IfModule>
windows2003下 規(guī)則文件httpd.conf ?。ㄔ谔摂M主機(jī)控制面板中用 “ISAPI篩選器自定義設(shè)置 " 開(kāi)啟自定義偽靜態(tài) Isapi_Rewite3.1 )
#Block ip
RewriteCond %{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR} (8.8.4.4|8.8.8.) [NC]
RewriteRule (.*) - [F]
windows2008下 規(guī)則文件web.config (手工創(chuàng)建web.config文件到站點(diǎn)根目錄)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="band ip" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="%{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR}" pattern="(8.8.4.4|8.8.8.)" />
</conditions>
<action type="AbortRequest" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
--w9941為你呈現(xiàn)
fansart:這么復(fù)雜, 我來(lái)補(bǔ)充linxu主機(jī)的拒絕訪問(wèn)機(jī)制 用.htaccess
order deny,allow
deny from 115.238.252.182
也可以批量拒絕
order deny,allow
deny from 115.238.252.*
評(píng)論(0人參與,0條評(píng)論)
發(fā)布評(píng)論
最新評(píng)論