Knowledge Base
How to Set Up Hotlink Protection in DirectAdmin
Preventing Image and Bandwidth Theft
Stop other websites from embedding your images and using your bandwidth.
What is Hotlinking?
Hotlinking is when another website displays your images by linking directly to files on your server. This uses your bandwidth without benefit.
Enabling Hotlink Protection
- Log into DirectAdmin
- Click Hotlink Protection
- Select the domain to protect
- Enter allowed URLs (your own domains)
- Select file extensions to protect (jpg, png, gif, etc.)
- Choose what to show when blocked (optional)
- Click Save
Allowed Referrers
Add domains that should be allowed to use your images:
- Your main domain (example.com)
- Webmail (mail.example.com)
- Search engines (optional)
Using .htaccess
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?yourdomain.com [NC]
RewriteRule .(jpg|jpeg|png|gif)$ - [F]
Alternative: Show Replacement Image
Instead of blocking, show a "don't steal bandwidth" image:
RewriteRule .(jpg|jpeg|png|gif)$ /hotlink-warning.jpg [R,L]