Introduction

Hotlink Protection in cPanel is a tool that prevents other websites from directly linking to files (especially images, videos, or downloads) hosted on your website. Without hotlink protection, other sites can embed your content using your bandwidth — which slows down your site and increases resource usage without any benefit to you.

This article explains how to enable and configure Hotlink Protection in cPanel to safeguard your files and server performance.


What Is Hotlinking?

Hotlinking is when another website displays or links to a file (like an image) hosted on your server, using your bandwidth. For example, if someone uses this code:

html
CopyEdit
<img src="https://yourdomain.com/images/photo.jpg">

...your server serves the image every time their site loads it.


Why Enable Hotlink Protection?

  • Protect bandwidth and reduce server load

  • Prevent copyright abuse of your media files

  • Discourage content theft

  • Speed up your site by minimizing external usage

  • Avoid unnecessary costs on hosting plans with bandwidth limits


How to Access Hotlink Protection

  1. Log in to your cPanel account

  2. Scroll to the Security section

  3. Click on Hotlink Protection


How to Enable and Configure Hotlink Protection

  1. Click "Enable" if the feature is currently turned off

  2. Under URLs to allow access, make sure your domains are listed (e.g., yourdomain.com, www.yourdomain.com)

    • You can add trusted domains like content delivery networks (CDNs) or partners

  3. Block direct access to these extensions:

    • Common types: .jpg, .jpeg, .png, .gif, .bmp, .pdf, .mp4, etc.

    • You can add or remove file types as needed

  4. (Optional) Redirect the request — Enter a URL to which hotlinked requests should be redirected (e.g., a warning page)

  5. Click Submit

Your settings will be applied immediately via the .htaccess file.


How It Works

Once enabled, cPanel adds rules to your .htaccess file that check the HTTP referrer header. If a request for a file comes from an unauthorized source, the server blocks it or redirects the request, depending on your configuration.


Things to Consider

Consideration Note
CDN Usage If using Cloudflare or another CDN, whitelist its domain
Search Engines Search engine bots typically don’t trigger hotlinking, but test to be sure
Embedded Media Some legitimate services (forums, partners) may be blocked — add them as exceptions
Testing Use browser dev tools or incognito windows to test if files are blocked properly

Disabling Hotlink Protection

If needed:

  1. Return to the Hotlink Protection page

  2. Click Disable

This removes the protection rules from your .htaccess file.


Troubleshooting

Problem Solution
Images not showing on your own site Make sure your domain is listed in the “Allowed URLs” box
File types not being blocked Ensure the file extension is included in the blocked list
Content blocked on legitimate sites Add those domains to the exceptions list

Conclusion

Hotlink Protection in cPanel is an essential security feature for protecting your website’s content and server resources. By enabling this tool, you prevent others from stealing your bandwidth and ensure your content is only accessed where you intend. It’s a quick and effective way to maintain 

Was this answer helpful? 0 Users Found This Useful (0 Votes)