How To Unprotect A Folder In Apache

The Apache HTTP web-server makes it easy to protect a folder (and its sub-folders) with a username/password prompt. Simply create a .htaccess file in the specified folder, and add something like this:

AuthName "Folder Protection"
AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
Require valid-user

For help with generating a valid .htpasswd file, you can use a tool like Dynamic Drive’s .htaccess Password Generator. There are plenty of tutorials online that explain this process.

On the other hand, it’s much harder to find information about unprotecting a sub-folder of a folder that is protected in the manner specified above. Some posts I read implied that it wasn’t possible at all. I finally found the answer here and here. Basically, in the sub-folder you’re trying to unprotect, you simply need to create a new .htaccess file and add the following:

Satisfy Any

Leave a Reply

2 Comments

  • Titash (Feb 23, 2008)

    Hi Moggy, I was curious how you’re able to display Archives and Tags as a page element in this site?

    I know it is little irrelevent to the topic but i don’t know how to reach you in person!

    Reply

  • Yan (Oct 24, 2008)

    Awesome! I’ve been searching for this for a while.

    Reply

Recent Comments

  • moggy: Do you have a phpinfo page? Does it list openssl? If not, it’s possible to install...
  • Micah: Does this plugin not work with Windows servers? It’s referencing OpenSSL but...
  • Chantak: Can you add the Poly1305-AES encryption in your plugin? The link is:...
  • Micah: I actually did set the nonces option to async and that didn’t work. I tried to...
  • moggy: @Micah — Thanks for the report. If you disable JavaScript in your browser you should...

Archives