Portal Home > Knowledgebase > Technical > How do I block an IP address from accessing my website?


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




You can use the built-in cPanel IP manager tool to prevent users from accessing your website by blocking their IP address.

To find a visitors IP address, use the web statistics tools. We suggest you go to cPanel and click the Latest Visitors icon. Look for the Host information; it could be an IP or a domain name.

To block an IP address.

  1. Login to cPanel and click IP Deny Manager.
  2. Under "Add an IP to deny", enter the IP address or domain name you wish to block.
  3. Click the Add button.

 

To unblock an IP address.

  1. Login to cPanel and click IP Deny Manager.
  2. At the bottom, under "Current IP addresses being blocked", click Remove.

 

You can also modify your .htaccess file to prevent everyone from accessing your website and allowing only specific IPs.

Here is a sample .htaccess file

deny from all

allow from 69.123.123.123
allow from 209.123.123.123

The above .htaccess file denies all requests except for ones from the IP address 69.123.123.123 and 209.123.123.123.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article