I have set up a password protected folder on my Apache server. I have a .htaccess file in the folder I want to protect, and a .htpassw in the Private folder.
The problem is when I enter the URL to the folder, the authorization challenge dialog appears as expected, but when I enter a URL with a specific download file name on the end, I can download it without being challenged.
My .htaccess file in the protected folder is as follows:
AuthUserFile /home/admin/web/example.com/private/.htpasswd
AuthName "Please Log In"
AuthType Basic
require user username
My .htpasswd file consists of:
username:abcdefghijs
So when I enter http://example.com/myfolder/myfile.zip it starts to download without the authorization challenge, but if I enter http://example.com/myfolder it works just fine. Clearly I need to prevent access to everything until the user is authorized.
Any thoughts would be appreciated.