I'm trying to put a stop to image hijacking with the following .htaccess code, but I can't figure out why it won't work .
I've tried placing the file in the root directory and the actual image directory, and neither work. Strangely, I've tested other rewrite rules, and they work fine (non-www to www addresss, for example).
I've tested by using free hotlink checkers and by trying to hotlink from my other domains, and been sure to clear cache on each test. No luck making it work though.
Am I missing something?
Edit: I just tried on a different domain, and the code below is blocking www hotlinking, but not when the www is not used to link to the image.
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?mysite\.com [NC]
RewriteRule \.(jpe?g|png|gif)$ - [NC,F]