Htaccess blocking


#1

I am trying to block image hotlinking by referrer (general hotlink
block is undesirable) but following in the .htaccess file does not seem
to work.

RewriteEngine On

block hotlinking images by referrer

Options +FollowSymlinks

RewriteCond %{HTTP_REFERER} ^http://domain.com/ [NC]
RewriteRule .*\JPG$ - [F]

Could someone point out where I have gone wrong?

Regards.


#2

RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?yourdomain.com [NC]


#3

Thanks for the tip - I have replaced the line as:
RewriteCond %{HTTP_REFERER} !^http://theirdomain.pl [NC]
but my images are still loading normally on the other site.

Reason I am unable to use hotlink blocking is that I am planning to use Google translation service and don’t want to block images from the translated pages.

Regards