Blocking IP addresses and stopping hotlinking Print

  • ip blocker, hotlink, block, security
  • 0

How to keep a bad visitor out of your site, and how to stop other websites from showing your images and eating your bandwidth.

Block an IP address

  1. In cPanel open IP Blocker.
  2. Enter a single address such as 203.0.113.7, a range, or a CIDR block such as 203.0.113.0/24.
  3. Click Add. The blocked list is shown below, and you can remove entries from there.

Find the address in Visitors or Raw Access under Metrics. Do not block your own address by mistake. A lot of real attackers rotate addresses, so for long lists a different approach is better.

Blocking whole countries

cPanel cannot block by country. If your domain uses Cloudflare (Using Cloudflare with your hosting), add a firewall rule there to block or challenge a country.

Stop hotlinking

  1. Open Hotlink Protection and click Enable.
  2. Check that your own domains, with and without www, are in the allowed list.
  3. Keep the extensions you want to protect, typically jpg, jpeg, gif, png, bmp.
  4. Tick Allow direct requests so people can still open an image by its address, and click Submit.

If it doesn't work

  • Your own images disappeared: your domain, with or without www, is missing from the allowed list.
  • Social networks stopped showing your preview image: add their domain to the allowed list.
  • Hotlinking still happens: the other site may be loading a cached copy. Check again later, or open a ticket (Opening a support ticket that gets answered quickly).

Was this answer helpful?

« Back