Protecting my .pdf files with .htaccess
-
Hi
I have a site on which I offer ebooks in pdf files and I want to protect my files from being downloaded by people who are not coming directly from my site, i browsed the forums before and found a topic
where someone mentioned to install Force User Login plugin and to create a .htaccess file in the directory where the .pdf files are located
IndexIgnore * Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www.)?myprotectedmemberssite.com/ [NC] RewriteCond %{REQUEST_URI} !hotlink.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx) [NC] RewriteRule .*.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx)$ http://yahoo.com/ [NC][NC][NC]I installed the Force User Login plugin, then pasted the above code and uploaded it as .htaccess to the directory where my .pdf files are located, but it’s not working
The line where it says {HTTP_REFERER} should I completely erase the website address along with the caracters next to the www. and the .com ?
I’m completely lost here? I already tried to replace the website in the {HTTP_REFERER} with my website, then when I tried to access one of the pdf files I did get redirected to yahoo.com but then I tried it while I was coming from my website and I was still being redirected to yahoo.com
I shouldn’t be redirected to yahoo.com if i’m coming from my site, so that’s what I don’t understand, I did change the {HTTP_REFERER} line with my website address, but should I just put http://www.mywebsite.com or should I put !^http://(www.)?mywebsite.com/ or should I put the website page where the link is located ( example !^http://(www.)?mywebsite.com/page.php ) ?
Can someone please help me and tell me what to do to make it work correctly ?
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
- The topic ‘Protecting my .pdf files with .htaccess’ is closed to new replies.