I have been trying to prevent hotlinking of images on a domain of mine without any success. I have added the following to /etc/apache2/httpd.conf
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !www.example.com [NC]
RewriteRule \.(jpg|jpeg|png|gif) - [F,NC,L]
This is the most basic example I have tried (this one is straight from the Apache site http://httpd.apache.org/docs/current/rewrite/access.html)
I have also tried adding a caret in front of the URL, adding slashes before the URL dots to escape them, making the www portion optional, adding https?
in front of the URL, and not using the blank referrer line. All without success.
Should I be placing the rules elsewhere (such as a VirtualHosts file)?