How to Use Hotlink Protection in cPanel

Hotlinking occurs when another website embeds your images or files directly using your server's URL, consuming your bandwidth without your permission. dotCanada's cPanel includes a Hotlink Protection tool that prevents this from happening.

Enabling Hotlink Protection

  1. Log in to cPanel and go to the Security section.
  2. Click Hotlink Protection.
  3. Click Enable to turn on hotlink protection.
  4. Review the settings that appear:
    • URLs to allow access - your own domain(s) are listed here by default. You can add other domains that you want to permit (e.g., a partner's site or a CDN).
    • Block direct access for the following extensions - by default, common image and media formats are listed such as jpg, jpeg, gif, png, bmp. Add other extensions as needed (e.g., mp4, pdf).
    • Allow direct requests - check this box if you want to allow people to access the files directly by typing the URL into their browser.
    • Redirect to URL - optionally specify a URL to show in place of the hotlinked file (e.g., a placeholder image or an error page).
  5. Click Submit to save your settings.

How It Works

Hotlink protection adds rules to your .htaccess file that check the HTTP Referer header on incoming requests. If a request for a protected file comes from a domain that isn't on your allowed list, the server denies the request.

Tips

  • If you use a CDN, make sure to add the CDN's domain to the allowed URLs list to avoid breaking your own assets.
  • Hotlink protection is particularly useful if you host popular images, downloads, or media files.

For help configuring hotlink protection or investigating unusual bandwidth usage, contact our support team.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today