How to ban any IP Address via .htaccess?

If someone is trying to hack your website or you want to block their IP Address, you can add this line to your .htaccess file.


order allow,deny
deny from IP-ADDRESS
allow from all


Replace "IP-ADDRESS" with the IP Address you want to block.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What is hotlink protection?

Hotlink protection is disabling external use of your resources. For instance, if your website has...

How do I configure hotlink protection?

Login to cPanel. Locate and click on the "Hotlink Protection" icon within the "Security"...

How do I block an IP address from accessing my site?

If you wish to ban a user from accessing your website in any way, the best way to do this is to...

How do I password protect a directory?

Login to cPanel. Locate and click on the "Password Protect Directories" icon under the...

How to protect your website's images from an external website?

External Website can use < img /> tag to display an image from your site somewhere else on...