HotLink Protection is used to prevent other websites from directly linking to files on your website. It is used to protect your images or other files from being Hotlinked on another website and it can be easily enabled through cPanel.
Steps to enable Hotlink using cPanel:
Step 1: Login to cPanel account.
Step 2: Click HotLink protection, Enter the domains that are allowed to use the files.
Step 3: If you want to block direct access to specific extensions, enter the extensions on the given space.
Step 4: Select the option, ‘allow direct requests’, to allow visitors access to specific content through the URL.
Step 5: Enter the direct URL on the tab “redirect the request to the following URL”.
How to enable hotlinking using .htaccess:
The following code is used in the .htaccess file for enabling the HotLink.
RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?DomainName/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpeg|jpg|gif|png)$ - [F]