I have thousands of pdf files on my website and I noticed that heaps of other websites have started stealing my pdfs by adding a direct link to these pdf files on their site. (sucks!). I have been desperately trying to prevent hotlinking to pdfs through my htaccess but it doesnt work. This is what I have in my htaccess:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC]
RewriteRule .*\.(pdf)$ http://www.mysite.com/index.php [R,NC]
I've also been searching the net for a long time and couldnt find a solution that works for pdfs. Most of them are for images, flash, etc and they also mention that it should work for pdfs too but it doesnt for me. I also read some suggestions to move the pdfs outside webroot. I dont want to do that neither. Its way too much work when I already have 1000s of pdfs on my site. Can someone please help me on how I can acheive this through htaccess. If it wont work using htaccess for pdfs, then how I can do it so people cant access my pdfs using a direct link or link referred from other sites?
Please keep in mind that I am still a newbie and new to all this. I am on CentOS using Apache and Nginx as reverse proxy. please help...