Search code examples
.htaccesspassword-protectionsubdirectory

How to remove .htaccess password protection from a subdirectory


I have password protected my entire website using .htaccess but I would like to expose one of the sub directories so that it can be viewed without a password.

How can I disable htaccess password protection for a sub directory? Specifically what is the .htaccess syntax.

Here is my .htaccess file that is placed in the root of my ftp.

AuthName "Site Administratrion"
AuthUserFile /dir/.htpasswd
AuthGroupFile /dev/null

AuthName secure
AuthType Basic
require user username1
order allow,deny
allow from all

Solution

  • You need to create a new .htaccess file in the required directory and include the Satisfy any directive in it like so, for up to Apache 2.3:

    # allows any user to see this directory
    Satisfy Any
    

    The syntax changed in Apache 2.4, this has the same effect:

    Require all granted