Blocking IP using .htaccess file
Written by Administrator   
Thursday, 01 May 2008
In case you want to block a certain IP address from entering your site, lets say you found a hacker or injector, you should use the .htaccess file to deny them from ever trying again.

To block an IP address from entering your site, edit the .htaccess file (you should find it in the root folder of your site).

Add this code:

order allow,deny
allow from all
deny from

After the "deny from" write down the IP you want to block. you can add as many lines as you like one below the other to block more IP's.


Related Items:

Write Comment

Code:* Code

Add as favourites (851) | Quote this article on your site | Views: 6434

Comments (4)
1. 26-04-2011 09:04
to allow only two user what will do.
Written by nasir (Guest)
2. 18-11-2010 12:09
unsupputed srisc
Written by young (Guest)
3. 23-02-2009 22:19
instead of "allow from all" write allow ....
Written by admin (Guest)
4. 13-07-2008 01:58
to deny all ip addresses and just include a few do you just reverse the words deny and allow?
Written by John (Guest)