Note: Revise according to requirement (8.8.4.4|8.8.8.) IP range
Linux rules file. htaccess (create. htaccess files manually to the site root directory)
<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 under
http://faq.myhostadmin.net/faq/listagent.asp?unid=795 First press This tutorial to open rewrite, and then add the following rules.
#Block IP
Rewritecond%{http_x_forwarded_for}&%{remote_addr} (8.8.4.4|8.8.8.) [NC]
Rewriterule (. *)-[F]
windows2008 the Rules file Web.config (create Web.config files to the site root directory manually)
<?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>