Hotlink protection helps prevent other websites from using your images, videos, or files by directly linking to them — a practice known as hotlinking. This can consume your bandwidth without your permission and slow down your website. With cPanel's built-in Hotlink Protection tool, you can block unauthorized access and keep your server resources under control.

This guide walks you through setting up hotlink protection in cPanel.

 

What Is Hotlinking?

Hotlinking occurs when another website embeds your media (like images or videos) by linking directly to files hosted on your server. This means your server handles the traffic every time someone visits their page, not just your own — consuming bandwidth and slowing your site down.

Hotlink protection prevents this by blocking external domains from accessing specific file types unless explicitly allowed.

 

How to Set Up Hotlink Protection in cPanel

Step 1: Log in to cPanel

  1. Go to your cPanel login page (e.g., https://yourdomain.com/cpanel).
  2. Enter your username and password and click Log in.

Step 2: Open the Hotlink Protection Tool

  1. In the cPanel dashboard, scroll to the Security section.
  2. Click Hotlink Protection.

Step 3: Enable Hotlink Protection

  1. On the Hotlink Protection page, click Enable to activate the feature.
  2. By default, this blocks external domains from directly accessing your media files.

Step 4: Allow Trusted Domains

In the “URLs to allow access” field, list the domains that are allowed to access your files. This should include:

  • www.yourdomain.com
  • yourdomain.com

  • Any subdomains (e.g. blog.yourdomain.com)

Separate each domain with a line break or space.

Tip: If you work with affiliates or partners who need to embed your media, be sure to add their domains here too.

Step 5: Choose What Happens When Hotlinking Is Blocked

  1. You can control how the server responds when hotlinking is blocked:
  • Show a 403 Forbidden error: Prevents access completely (default option).

  • Redirect to a custom error page: Send users to a custom warning or landing page.

  • Show a default image: Replace the requested file with a placeholder (e.g. a “Hotlinking not allowed” image). Upload the image URL in the field provided.

    2. Click Submit to save your changes.

 

How to Test Hotlink Protection

Try embedding one of your protected media files on a different domain. If protection is working correctly, users on that domain will either:

  • See a 403 Forbidden error

  • Be redirected to your custom page

  • See your placeholder image

 

How to Disable Hotlink Protection

If you ever want to turn the feature off:

  • Go back to the Hotlink Protection tool in cPanel

  • Click Disable

Your media will then be accessible again from all sources.

 

Important Notes

  • Whitelist carefully: Only allow trusted domains to avoid exposing your content to scraping or abuse.

  • File types: Protection applies to common media files like .jpg, .png, .mp4, .gif, etc.

  • SEO impact: If other legitimate websites link to your images, blocking them may affect your image visibility in search engines. Whitelist partners accordingly.

 

For help with hotlink protection settings or troubleshooting issues, contact Lanetti support. We’re here to help you keep your site secure and running smoothly.

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