Skip to main content

HotLink protection on Linux with .htaccess file

Here I have added an exception for our domain “yourdomain.com” on HotLink protection. The rules are given below:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|img)$ – [NC,F,L]

Comments