Si8
Si8

Reputation: 9225

.htaccess set up issue

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

Upvotes: 2

Views: 124

Answers (1)

anubhava
anubhava

Reputation: 784898

You don't need to take refuge of Basic Authentication. Just put this line in your root .htaccess file:

Options -Indexes

And don't forget to comment out Basic Authentication code.

Upvotes: 1

Related Questions