Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htaccess adding password while enabling directories view in browser

Okay this might be a very obvious one however...

I have the following in my .htaccess file

AuthType Basic
AuthName "Message"
AuthUserFile /www/sites/5ce/448/domainname/folder.htpasswd
require valid-user

Which works fine for password protecting the folder it's placed in.

I also have in another .htaccess file (when I remove the first one)

Options +indexes 

Which works fine for showing the directory folder and included files on browser.

When I put these together i get Error 500. How do you essentially enable directory view but password protected?

like image 833
Michael Avatar asked Feb 20 '26 16:02

Michael


1 Answers

There shouldn't be a space between the + and the indexes.
Try this:

AuthType Basic
AuthName "Message"
AuthUserFile /www/sites/5ce/448/domainname/folder.htpasswd
require valid-user
Options +Indexes 
like image 130
Dekel Avatar answered Feb 23 '26 11:02

Dekel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!