0

I need to protect files within a directory, I used .htaccess file as below and put it in the directory :

AuthType Basic
AuthName "Authentication Required"
AuthUserFile "c:\passwords\.htpasswd"
Require valid-user

It works fine when I browse the directory example.come/directory, but it doesn't work when I browse example.come/directory/aFile.zip. It doesn't ask for user and password.

How can I protect files in the directory?

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
siavash
  • 3
  • 3
  • If you entered your credentials when visiting example.come/directory then your browser won't ask again if you visit example.come/directory/aFile.zip, it uses the cached credentials. – wurtel Jan 31 '18 at 08:24
  • @wurtel I tested example.com/directory/aFile.zip with another browser. – siavash Feb 03 '18 at 02:22

0 Answers0