Question: How do I enable hotlink protection? Print

  • GHFS web hosting, VPS hosting setup, GHFS Hosting, GHFS cloud hosting, best hosting provider, shared hosting guide, managed hosting services, email hosting setup, SSD web hosting, how to register a domain, domain and hosting tutorials, hosting knowledge base, hosting control panel tutorial, SSL installation guide, DNS records explained, DNS configuration guide, how to transfer a domain, CNAME configuration, MX record setup, SSL certificate troubleshooting, A record guide, WordPress migration guide, WordPress installation GHFS, optimize WordPress performance, fix internal server error, enable SSH access, MySQL database tutorial, secure VPS server, FTP upload guide, Linux server commands, PHP configuration guide, website security tutorial, malware removal guide, secure hosting best practices, DDoS protection GHFS, firewall configuration VPS, disable root login SSH, VPS hosting tutorial, Apache configuration guide, cloud server configuration, how to manage Linux VPS, Nginx setup GHFS, install Docker on VPS, Redis installation, MySQL optimization, hosting troubleshooting guide, SSL troubleshooting, Node.js on VPS, secure website setup, Python hosting tutorial, hosting performance optimization, cPanel tutorial, Plesk tutorial, SMTP configuration guide, email deliverability guide, server hardening tutorial
  • 0

This article explains how to enable hotlink protection on GHFS Hosting using Plesk. Hotlink protection prevents other websites from directly linking to your images, videos, or other files, which helps save bandwidth and protects your content.


1. What Is Hotlink Protection?

Hotlinking happens when another website displays files stored on your hosting account by directly using their URL.

Example:
They embed your image like:
https://yourdomain.com/images/photo.jpg

This uses your bandwidth, not theirs.

Hotlink protection blocks these external requests.


2. How to Enable Hotlink Protection in Plesk

Plesk controls hotlink protection through Apache/nginx settings or additional directives.

Steps:

  1. Log in to your Plesk control panel

  2. Go to Websites & Domains

  3. Click Apache & nginx Settings for the domain

  4. Scroll to Additional Apache directives

  5. Add the following code:

 
 
RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !yourdomain\.com [NC] RewriteCond %{HTTP_REFERER} !www\.yourdomain\.com [NC] RewriteRule \.(jpg|jpeg|png|gif|bmp|svg|webp)$ - [F,NC]

Replace yourdomain.com with your actual domain.

  1. Save the changes

  2. Clear your browser cache and test

Hotlink protection is now active.


3. How This Rule Works

The rule blocks access to image files unless the visitor came from:

Any other website trying to load your images will receive a 403 Forbidden response.


4. Allowing Certain Websites

If you want to allow specific partner sites to use your images:

Add more allowed referers:

 
 
RewriteCond %{HTTP_REFERER} !partnerwebsite\.com [NC]

Add as many exceptions as needed.


5. Protecting Additional File Types

You can extend protection to video, audio, or document files:

 
 
RewriteRule \.(mp4|mp3|avi|pdf|zip)$ - [F,NC]

Add these to the existing rule if needed.


6. Testing Hotlink Protection

To confirm it works:

  1. Open another website or a test HTML file

  2. Insert a direct URL to your image

  3. Load the page

If protection is active, the image will NOT load.


7. When to Contact GHFS Hosting Support

Contact support if:

  • Hotlink protection does not work

  • You accidentally blocked your own website

  • You need help writing custom rules

  • You are unsure where to place the code

  • Your site uses nginx-only hosting and requires different configuration

Support can help configure and troubleshoot hotlink protection safely.


Was this answer helpful?

« Back