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
- Log into cPanel
- Go to Security > Hotlink Protection
- Click Enable button
- 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
- Click Submit
Allow Specific Websites
If you want certain sites to hotlink (e.g., your own other domains):
- In "URLs to allow" field
- Enter domain without http:// (e.g., trustedsite.com)
- 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
- Upload a custom "hotlink blocked" image to your server
- Enter its URL in "Redirect URL" field
- Hotlinkers will see this image instead
Testing Hotlink Protection
- Enable protection
- Create test HTML file on different domain
- Link to your image:
<img src="https://yourdomain.com/image.jpg"> - Image should not display (or show redirect image)
Disable Hotlink Protection
- Return to Hotlink Protection in cPanel
- 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