How to Set Up Hotlink Protection Print

  • 0

Enabling Hotlink Protection

Hotlink protection prevents other websites from directly linking to your images/files, saving bandwidth.

What is Hotlinking?

When other sites use your images by linking directly to your URLs, you pay for their bandwidth. Example: They display your image on their site, but the image loads from your server.

Enable Hotlink Protection

  1. Log into cPanel
  2. Go to Security > Hotlink Protection
  3. Click Enable button
  4. Configure settings:
    • URLs to allow: Add trusted sites (optional)
    • Extensions to protect: jpg, jpeg, gif, png, bmp (pre-filled)
    • Block empty referer: Usually leave unchecked (allows direct browser access)
    • Redirect URL: Optional image to show instead of blocked content
  5. Click Submit

Allow Specific Websites

If you want certain sites to hotlink (e.g., your own other domains):

  1. In "URLs to allow" field
  2. Enter domain without http:// (e.g., trustedsite.com)
  3. One domain per line

Add More File Types

To protect additional file types:

  • Add extensions to the list: pdf, mp3, mp4, zip, etc.
  • Separate with commas

Custom Redirect Image

  1. Upload a custom "hotlink blocked" image to your server
  2. Enter its URL in "Redirect URL" field
  3. Hotlinkers will see this image instead

Testing Hotlink Protection

  1. Enable protection
  2. Create test HTML file on different domain
  3. Link to your image: <img src="https://yourdomain.com/image.jpg">
  4. Image should not display (or show redirect image)

Disable Hotlink Protection

  1. Return to Hotlink Protection in cPanel
  2. Click Disable

Alternative: CDN

Consider using a CDN (CloudFlare, etc.) which:

  • Offers advanced hotlink protection
  • Caches files globally
  • Reduces bandwidth on your server
  • Often includes free plans

Was this answer helpful?

« Back

Powered by WHMCompleteSolution