I have been having a similar problem with my .htaccess file. I also want to disable hotlinking, for which I used the following code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^
http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
When I use this though (which I believe is written correctly) my server then blocks my own domain as well. Hence, none of the images on my site work if I try and disable hotlinking. I contacted the support people at my server, and they just told me that their system randomly rewrites htaccess files. Is that normal?
I would like to know more about protecting files by putting them in a non-web accessible folder, as states below:
"Put the files in a non-web accessible directory and store the paths in a database then in the pages the links for the files will run through the database which you can then control and people can't hotlink."
Im guessing this is some form of PHP script? Or? If someone could post a tutorial link for how to accomplish this that would be great. The tutorial would have to be rather detailed though since I have no idea how to write PHP.
Any help is appreciated. Much as I ask people not to direct link to media on my site, everyone does!