Showing Forbidden Files
Problem
Password-protected files and directories don’t show up in the directory listing.
Solution
If you’re running Apache 2.2, place the following IndexOptions directive in a <Directory> block referring to the directory in question, or in a .htaccess file in that directory:
IndexOptions +ShowForbidden
If you’re running Apache 2.0, there is no solution.
Discussion
Starting with Apache 2.0, directory listings attempt to protect protected documents. So if a file or directory requires password authentication, it is not shown in a directory listing.
In Apache 2.0, this is simply how things work. There is no way to have forbidden files or directories shown in directory listings.
In Apache 2.2, the ShowForbidden argument was added for the IndexOptions directive, specifically to address this request.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access