How do I block IP Addresses? Print

  • 0

In your CPanel account - go to "Site Management" and then select "Ip Deny Manager"

Another method using .htaccess

If you need to block an IP address from accessing a directory on your site, place the following into an .htaccess file located in the directory you wish to block their access from:

Order Allow,Deny
Allow from all
Deny from 111.111.111.111

Replace 111.111.111.111 with the IP you wish to block.

If you need to block more than one ip:
Order Allow,Deny
Allow from all
Deny from 111.111.111.111
Deny from 222.222.222.222

If you wish to deny access to an entire block of IPs, only give a portion of the IP:

Order Allow,Deny
Allow from all
Deny from 111.111
(be careful as this method can block thousands of IPs, including those that may be friendly)


Was this answer helpful?

« Back