Authenticated directory listing
Posted by: EnPa
Posted on: 2007-01-31 04:59:00
Hi,
I am hosting some pages at DH.
I know how to block directory listing for everyone:
"Options -Indexes" in the .htaccess file.
How can I make the server ask for authentication (like .htpasswd) and allow listing only on successful login?
Let me (try to) explain what I want to do...
If I go to http://mydomain.com/some-directory/ I want to be prompted for a password.
If the password is correct, I get the standard directory listing generated by Apache.
If the password is wrong I should get a 403 status code or an empty page.
BUT: the files in the directory must be accessible for everybody.
If I type http://mydomain.com/some-directory/some-file.jpg I should be able to see the pic without being prompted for a password.
I cannot use IP-based solutions.
Thank you in advance
EnPa
P.S.: sorry for my bad english...