apache:allow_full_access_to_the_apache_subdirectory

Apache - Allow full access to the Apache subdirectory

Usually, people will set basic authentication for apache directory (normally /var/www/html in centos).

The reason is to protect the directory from unauthorized access.

But what if a subdirectory inside (let say /var/www/html/mydirectory) needs full access? This is where .htaccess file comes into picture.

To allow access to /var/www/html/mydirectory while maintaining authentication for /var/www/html, just follow below steps:

1. Go to /var/www/html/mydirectory

cd /var/www/html/mydirectory

2. Create .htaccess file

touch .htaccess

3. Put below items into that .htaccess file

.htaccess
Allow from all
Satisfy Any

4. Restart Apache:

sudo httpd -k graceful

5. Try to access http://servername/mydirectory using your browser. This should give access without a password.

apache/allow_full_access_to_the_apache_subdirectory.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki