Block IP addresses using .htaccess file

Blocking IP addresses using .htaccess file
Manytime you need to block certain IP which is threatening your website/server or is trying to attack your server by creating load on it [ DDOS attack] then you can easily block such IPs using .htaccess file. Once you manage to get the IP address which is playing with your server then you just need to add it in deny list of htaccess file. All IPs which are listed in this list cant access your site anymore and thus you can protect your server from such attacks. All you have to do is to add IP in your htaccess file which is located at root directory by using following code.
<Limit GET>
order deny,allow
deny from IP address
</Limit>

You can add as many IP address as you want in this list. One thing to be noted that spammers/hackers can change their IP addresses very easily as most spammers work from their home PCs which are not static and may update very often. Thus is may be very difficult for you to get exact IP address which you need to block. So its always better to get a good firewall for your server or a webhost who will manage your dedicated server for such security issues and will monitor it round the clock.

Posted under Fantastico Hosting, Reseller Hosting, WHM cpanel Hosting, cPanel account Hosting

This post was written by admin on November 25, 2008

Tags: , , ,