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.

Was this answer helpful?

 Print this Article

Also Read

php error: Allowed memory size of x bytes exhausted

If you are getting an error like "Allowed memory size of... in file...

How to update DNS Nameserver on Godaddy?

After purchasing our hosting account, you will receive a Welcome email from us which contains our...

How to update DNS Nameserver on DynaDot?

After purchasing our hosting account, you will receive a Welcome email from us which contains our...

What is Softaculous?

Softaculous is an Auto-Installer that allow automated installation of a script through a single...

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...