Preventing unwanted image hotlinking with cPanel

Hotlink Protection can restrict other sites from embedding selected files hosted on your account. It can reduce unwanted bandwidth use, but it is not digital-rights protection and cannot prevent someone from downloading and republishing a public image.

What you need before you begin

List every legitimate hostname that embeds your files, including www, subdomains, a shop frontend and any required preview or CDN domain. Record the current settings before changing them, because disabling the feature can clear its allowlist.

01 Prevent unwanted image hotlinking with cPanel

  1. Open Hotlink Protection in cPanel and enable the feature when appropriate.
  2. Review the allowed URLs and include the legitimate website variants. A missing secure or alternate hostname can cause your own pages to show broken images.
  3. Select only the extensions you intend to protect. Consider feeds, newsletters and external business integrations before blocking a file type broadly.
  4. Decide whether direct requests should be permitted. This affects visitors opening an image URL without an ordinary referring page, so test that use case deliberately.
  5. Save the configuration, then test images from your own pages and from an unauthorised external embedding page. If using a cache or CDN, clear only the relevant cached test objects when necessary.

Confirm the expected result

Your website should display its assets normally while the unwanted embedding request is restricted according to the saved rule. Test mobile and private browser sessions as referrer handling can differ.

Why are legitimate website images blocked by Hotlink Protection?

If legitimate images fail, review allowed URLs and referrer policy rather than changing file permissions to 777. Temporarily restore the previous hotlink settings to isolate the cause. Keep a copy of the allowlist before disabling the feature for troubleshooting.

Sources and further reading

  • 0 Users Found This Useful
  • cpanel-whm, security-ssl
Was this answer helpful?

Related Articles

Password-protecting a website folder with cPanel Directory Privacy

Directory Privacy places a browser login in front of a website folder, making it useful for a...

Blocking an unwanted website visitor with cPanel IP Blocker

IP Blocker restricts website access from an address or range. It is a web access control, not a...

Diagnosing a legitimate request blocked by ModSecurity in cPanel

ModSecurity is a web application firewall that can block suspicious requests before the...

Enabling two-factor authentication for a cPanel login

cPanel two-factor authentication adds a time-based code to the panel login after the password....

Replacing or removing cPanel two-factor authentication

When changing phones, reconfigure cPanel 2FA so the new authenticator can generate valid codes....