how to block IP Address By Using htaccess?

Written By Namaqu Aoi on Friday, June 22, 2012 | 8:35 AM

If you have a website and want to block certain IP addresses so that the IP Address can not access your website, you simply create a file with a name .htaccess and in place in the main directory of your website.

follow these steps:







Create a file named .htaccess file and fill it with one of the following script:
To perform a block on a single IP Address
order allow,deny
deny from 127.0.0.1
allow from all
To block Multiple IP Address
order allow,deny
deny from 127.0.0.1
deny from 127.0.0.2
deny from 127.0.0.3
allow from all
 To block the IP address range 127.0.0.0 to 127.0.0.255
deny from isp_name.com
* note: Replace the example IP address above with the IP address you want.

0 comments:

Post a Comment