How do I ban an 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.

Website packages like WordPress have more advanced facilities available to add (Wordfence in the case of WordPress) to provide these facilities.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I protect a website folder with a username and password in cPanel?

You can lock a directory with password by using the cPanel "Password Protected Directories"...

How do I blacklist an IP Address to deny it access to my website?

1. Log into your cPanel account.2. In the "Security" section, click on "IP Blocker" Icon. 3....

How do I restrict web folder access by IP address?

In order to secure your admin area from hackers, we recommended you to allow access only from...