Hello Friends !!
In my previous post, i was write how to block IP address using PHP script ?
Today i will write that how to block IP address using .HTACCESS ?
There are several ways to block a specific IP range.
The first utilizes a CIDR number to block the specified range (via htaccess):
<Limit GET POST PUT>
order allow,deny
allow from all
deny from 214.53.25.64/26
</Limit>
The second method is similar, only here we are expressing the range in netmask notation, using corresponding network/netmask values:
<Limit GET POST PUT>
order allow,deny
allow from all
deny from 214.53.25.64/255.255.255.192
</Limit>
The third method tests all IP addresses against a predefined regular expression via RewriteCond/RewriteRule directives:
RewriteCond %{REMOTE_ADDR} ^214\.53\.25\.(6[4-9]|7[0-9]|8[0-9]|9[0-9])$ [OR]
RewriteCond %{REMOTE_ADDR} ^214\.53\.25\.1([0-1][0-9]|2[0-8])$
RewriteRule .* – [F]
Here is a way of blocking a specific ISP via its IP address(es).
Order Allow,Deny
Allow from all
Deny from 123.123.123.
Deny from 456.456.456.
</Files>
There is probably a more efficient way to write the regular expressions in the previous example, but that should definitely get the job done.
I think this post become useful to you.


HI
this tutorial is very help ful for me thanks
HI
[...] Block IP addresses Using .HTACCESS [...]
[...] [upmod] [downmod] Block IP addresses Using .HTACCESS | php genious (phpgenious.com) 1 points posted 2 months, 1 week ago by SixSixSix tags webdesign imported [...]
Someone help me, please. I am not able to get my .htaccess file to work. It crashes the site. I know my problem lies with the syntax prior to the .
Thanx.
Garry
garrysch@swbell.net
how can i block a ip range like this
5.8.12.0.0 — 5.8.255.255
5.8.12.0.0 ? Is it right address ? Please provide right address range .