Hotlinking is when another website embeds your images or files directly from your server, consuming your bandwidth without permission. Hotlink protection blocks this and keeps your bandwidth for your own visitors.
Enabling Hotlink Protection in cPanel
In cPanel, go to Security > Hotlink Protection and click Enable. Enter the URLs that are allowed to hotlink from your server (add your own domain). Choose which file extensions to protect (typically jpg,jpeg,png,gif,webp,pdf). Click Submit.
Custom Hotlink Rules via .htaccess
For more control, add these rules to your public_html/.htaccess:
RewriteEngine on\nRewriteCond %{HTTP_REFERER} !^$\nRewriteCond %{HTTP_REFERER} !^https?://(www\.)?yourdomain\.com [NC]\nRewriteRule \.(jpg|jpeg|png|gif|webp)$ - [F] Testing Hotlink Protection
Try embedding one of your images on another website (or an HTML file on a different domain) and check if it loads. If protection is working, the image should fail to load or show a replacement image instead.