How to Configure Hotlink Protection in cPanel
Hotlink protection prevents other websites from directly embedding your images or other files on their pages. This conserves your bandwidth and resources. This guide shows you how to set up this security feature.
Step 1: Accessing Hotlink Protection
- Log in to your cPanel control panel.
- In the cPanel main interface, navigate to the Security category and click on the Hotlink Protection link.
Step 2: Defining Protection Rules
- To activate or deactivate the feature, click on the Enable or Disable button provided at the top of the page.
- Under the section titled URLs to allow access, enter your domain name and any subdomains that must be able to load resources from your server (such as your own blog or staging site).
- In the next section, specify the file extensions that you want to protect from direct linking (e.g., .jpg, .png, .gif). Common file types are usually pre-populated.
- Choose whether to allow direct access to protected files. If enabled, the file can be accessed directly by typing the URL into a browser, but it cannot be embedded on an external web page.
- Optionally, you can enter a Redirect URL. Requests that are blocked due to hotlinking will be sent to this URL instead. This is often used to display a message like Hotlinking is not allowed.
Step 3: Saving the Configuration
- Click the Submit button at the bottom of the page to save and implement your new Hotlink Protection settings.
Your server's resources are now protected from unauthorized external use.