Password Protect a Folder of Documents

I’ve got a folder full of downloadable docs on a site that only logged in folks should be able to access.
However, I’ve not been able to find a working method to prevent direct linking to the docs.
Maybe relevant: most of the site is Wordpress.
Section in question is a subsection of the site, but not Wordpress, and in a seperate folder
Also, my htaccess file forces all addresses over to https - maybe relevant as well, I dunno…

First, I tried protecting the folder through CPanel settings. Didn’t work. I simply get a 404 “file not found” error instead of the prompt for the password. Remove the CPanel security setting - linking to the files work again.

I also tried it using the htaccess file like:

AuthType Basic
AuthName "restricted area"
AuthUserFile /home/mysite/public_html/protecteddocuments\.htpasswd
require valid-user

Same result - 404 not Found…
If I comment the code above out - I can link to the files in question again.

I’m kinda lost at the moment now. Either of these SHOULD have worked (or so it seems), but there must be something somewhere that interfering with it. Ideas?

you change mod full control

Looking at the folder through FTP, it’s currently set to 755.
What should it be set to?
Actually, I’m not 100% sure how that makes a difference. Explanation?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.