Protect Directory
-
I Need your help. I have a WordPress Site up and running since about 4 months and I’m very happy with it. My Webpage has two separate areas, a members only area and a public area. I use the CaPa plugin for this protection. WordPress itself is installed in subdirectory and with .htaccess I access it from the root.
I like to protect a document folder with several subfolder direct access from outside of WP. This folder can be in wp upload folder or outside. I have mainly pictures in a flash slideshow and some sensitive pdf or swf documents which are only for members. It can happen that a search engine find and publish some of this documents and I want prevent this. I can protect this directory with the cpanel, but I don’t want that the member has to login twice.
Is there a plugin or any help for a non programmer? I tried several options I have found in the forum with .htaccess but without any success. Probably the installation in a folder makes it more difficult. But I’m pretty sure you guys find a solution.
I tried this .htacces in the document folder but then I can’t access the files anymore even when I’m logged in. I get directly redirected to the homepage.
IndexIgnore *
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https://(www\.)?myserver.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)$ https://myserver.com/ [NC]
- The topic ‘Protect Directory’ is closed to new replies.