Apache .htaccess

I came across a weird issue yesterday, a friend of mine was password protecting a folder with a .htaccess and .htpasswd file. Picture the file structure

folder1 with a number of files in it and subfolders.
folder2 inside folder1 that’s passworded with a .htaccess .htpassword

The conf file for the site allowed options +indexes so that the contents of folder1 showed it’s files and folders. Here’s the weird part, folder2 wasn’t listed. If you renamed the .htaccess in folder2 then it would be shown and my friend just couldn’t figure it out.

While he was calming down after getting stressed, I took it upon myself to find a solution and after 25 mins or so googling I had a solution.

Create another .htaccess file in folder1 with

# show directories containing .htaccess file
IndexOptions ShowForbidden

Simples when you know how eh!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s