HotLink protection allows you to block other websites from directly linking and using your files on their website (for example images). If you are not using HotLink protection then other websites could link to your files which would increase your site bandwidth usage. Luckily cPanel has a built-in tool where you can enable HotLink protection with a single click.
Before you begin this guide you’ll need the following:
- Access to control panel of your hosting account
Configuring HotLink protection in Hostinger control panel is quick and easy. To begin, you will need to navigate to Hotlink Protection section located under the Other category.
You will then be redirected to a setup screen.
- URLs to allow access includes your domain name by default, otherwise access would be blocked to your own domain as well.
- Block direct access to these extensions section allow you to choose what type of files should be protected. We recommend enabling it for ALL file extensions.
- Direct requests lets you choose whether you want to allow visitors to access your images or other media (for example: yourdomain.com/image.png)
- Redirect blocked requests to this URL has the ability to redirect blocked requests to a specific page.
Once these sections are reviewed and filled-in, toggle Enable and press Save to apply the new settings.
Congratulations, HotLink protection has been successfully enabled for your website!
Firstly, access your cPanel and click on the HotLink Protection icon located under the Security category.
Next, you will be prompted with the HotLink protection setup screen.
- Enable HotLink protection.
If you want to change default configuration then view the options 2-6 below.
- URLs to allow access: – enter websites that you want to allow direct linking to your files. By default, this area should be automatically filled with your domain names.
- Block direct access for the following extensions (comma-separated): – here you can enter separate file extensions that you want to block direct access to.
- Allow direct requests – tick this box if you want to allow direct access via a browser (for example when an image is being opened directly via URL yourdomain.com/image.png).
- Redirect the request to the following URL: – If you want you can redirect requests that were blocked to a certain URL, for example, one of the pages on your domain name. It would need to be a valid URL in a form of http://yourdomain.com/somepage.php.
- Click Submit to save all your changes.
That’s it, now your files on the server are protected from being linked by unwanted websites.
IMPORTANT! If you noticed that files like images or videos stop working after you have enabled HotLink protection then make sure that your domain is added to the URLs to allow access list.
In this tutorial, we have learned how to enable HotLink protection for your website. It will save your server bandwidth from being used by someone else without your permission.