How to Enable Hotlink Protection (Prevent Others from Stealing Your Media)
Hotlinking is when other websites directly link to your media (like images or videos), using your bandwidth. You can protect your resources using built-in tools in cPanel or manually in DirectAdmin.
Evans
Last Update hace 2 meses
a) For cPanel Users
Log in to cPanel
Locate Hotlink Protection
Scroll to the Security section.
Click on “Hotlink Protection.”
Enable Hotlink Protection
Click the Enable button if it’s not already enabled.
Specify Allowed Domains
Your domain should already be listed.
Add any other domains you trust (e.g., subdomains or CDN).
Specify File Types
Common types to protect: jpg, jpeg, png, gif, bmp, webp, mp4, etc.
(Optional) Redirect Hotlinked Requests
You can enter a URL (e.g., an image that says "no hotlinking allowed").
Click “Submit” to Save Changes
Done! Your media files are now protected against hotlinking.
b) For DirectAdmin Users
DirectAdmin currently doesn’t have a native GUI tool for hotlink protection, but you can do it via .htaccess.
Step-by-Step:
Log in to DirectAdmin
Go to: https://yourdomain.com:2222
Open File Manager
Navigate to:
System Info & Files → File Manager → public_html
Edit or Create .htaccess
Right-click on .htaccess and choose Edit, or click Create new file if it doesn't exist.
Paste the Following Code:
Replace yourdomain.com with your actual domain.
What this does:
Allows media loading only from your own domain.
Blocks direct access from other websites.
Prevents bandwidth theft from hotlinked files.
(Optional) To Redirect to a Custom Image:
Verify Hotlink Protection
After setting up:
Try embedding an image from your site on an external site or tester.
If protection is working, the image won't load (or will be replaced with your redirect image).