2

I have a folder in my htdocs folder ChemLabDB and inside the directory I have my HTML files that the user can browser from their browsers. When the user put the path to the directory, the browser displays all the files. I put the .htaccess and .htpasswd file in the directory. Now everytime I visit the website, I get a enter password prompt.

My Directory: enter image description here

My .htaccess file:

AuthType Basic
AuthName "Not Available to Users"
AuthUserfile "../htdocs/ChemLabDB/.htpasswd"
Require valid-user

What do I modify so the user can browse without having to enter authentication credentials. The only time a user is REQUIRED (for security) to enter is when they try to browse the directory?

enter image description here

4

1 回答 1

1

你不需要避难Basic Authentication。只需将此行放在您的根.htaccess文件中:

Options -Indexes

并且不要忘记注释掉Basic Authentication代码。

于 2013-10-07T16:08:29.117 回答