Skip to main content

How to enable Hotlink protection in cPanel

Use Hotlink protection in cPanel to prevent other websites from using images, files, and other content directly from your website. This guide shows how to enable, configure, and disable Hotlink protection.

Overview

Hotlink protection prevents other websites from loading files directly from your site using your bandwidth.

When Hotlink protection is enabled, you can:

  • Prevent unauthorized use of images and files

  • Limit which websites have access to your content

  • Block direct access to specific file types

  • Redirect requests to another URL

When you finish this guide, you will know how to manage Hotlink protection in cPanel.


Important information

When you enable Hotlink protection, make sure to allow the necessary domains.

This can be, for example:

  • Website Subdomains

  • The domain you use to log in to cPanel

  • Other websites that should have access to your content

If these domains are not allowed, some files may stop working as expected.


Prerequisites

Before you start, make sure you:

  • Have access to cPanel

  • Are logged into cPanel

  • Have an active webhosting package with cPanel support


Step 1: Log in to cPanel

If your hosting service supports cPanel, you can log in directly from the landing page in the client area.

This is how you do it:

  • Find your hosting service under the list of active products/services

  • Click on the "Log in to cPanel" button

  • You are now automatically logged into cPanel without having to enter your username or password again


Step 2: Enable Hotlink protection

To enable Hotlink protection:

Open Hotlink Protection in cPanel

Click on Enable

The system now opens a new page that shows:

  • Allowed referrers

  • Protected extensions

Click on Go Back to continue with the configuration

šŸ’” Tip: Enable the protection before adding your own rules so that all settings are saved correctly.


Step 3: Allow specific websites

If certain websites are to be able to use files from your site, they must be added as permitted with the following steps:

  1. Find the URLs to allow access field

  2. Enter the URLs that should have access

  3. Save the changes by clicking on Submit

Examples can be:

  • Website's own subdomains

  • External websites you partner with

  • Alternative domains that point to your website


Step 4: Block specific file types

You can prevent direct access to specific file types by doing the following:

3. Find the Block direct access for the following extensions:
4. Enter the file types you want to protect, separated with commas

Examples:

  • .jpg

  • .png

  • .gif

When a file type is blocked, other websites cannot hotlink to these files regardless of other settings.


Step 5: Allow direct URL access

If you want visitors to be able to open files directly via URL, you can enable it with the following option:

5. Check the Allow direct requests checkbox

6. Save the changes by clicking on Submit

When the setting is enabled, users can open files directly by visiting the file's URL.

Example:


Step 5: Redirect blocked requests

You can send visitors to another page when a blocked request is detected as follows:

7. Find the field Redirect the requests to the following URL:

8. Specify the URL you want to forward visitors to

9. Save the changes by clicking on Submit

This can be used, for example, to display an information page or the website’s front page.


Step 6: Disable Hotlink Protection

If you no longer want to use Hotlink protection, you can disable the feature by clicking on Disable:

āš ļø Important: When you disable Hotlink protection, the list of allowed URLs is automatically deleted.

We therefore recommend that you save the list locally before disabling the feature.


Troubleshooting

Photos do not appear on my website

Make sure that your domain or subdomain is added to the list of permitted URLs.

Some files are unavailable

Check that the file extension is not added to the list of blocked file extensions.

The changes don't seem to work

Try to clear your browser cache and test it again.


Summary

You’ve now learned how to enable, configure, and disable Hotlink protection in cPanel.

By using Hotlink protection, you can reduce unwanted use of your website’s files and help save bandwidth on your web space.

Did this answer your question?