1

I am trying to run an internal apache server. I am trying to make a homepage like http://internalserver/ This will have a number of files and folders. I am trying to password protect one of these sub-folders. I am using .htaccess for this.

My problem is that, after this has been done, my password protected subfolder is not visible in my base directory http://internalserver/
If I access http://internalserver/passwordprotected/ directly from the browser, I am able to get the password prompt and subsquently navigate
I am running apache2.4 on Ubuntu14
I would like to be able to see the passwordprotected directory listing, and when trying to access it, get the password prompt

1
  • What have you tried thus far to get this working? Did you research how to show directory contents in Apache?
    – EEAA
    Jan 7, 2016 at 13:29

1 Answer 1

2

You must add ShowForbidden

http://www.rfc3092.net/2013/09/apache-doesnt-show-protected-folders-foo/

IndexOptions +ShowForbidden

Do restart Apache after adding this line.

For reference:

https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html#IndexOptions

ShowForbidden If specified, Apache httpd will show files normally hidden because the subrequest returned HTTP_UNAUTHORIZED or HTTP_FORBIDDEN

1
  • This worked for me, I had given IndexOptions in the directory which was protected not its root folder
    – bobby
    Jan 7, 2016 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .