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:
...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
-
Log in to your cPanel account
-
Scroll to the Security section
-
Click on Hotlink Protection
How to Enable and Configure Hotlink Protection
-
Click "Enable" if the feature is currently turned off
-
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
-
-
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
-
-
(Optional) Redirect the request — Enter a URL to which hotlinked requests should be redirected (e.g., a warning page)
-
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:
-
Return to the Hotlink Protection page
-
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