The purpose of using the “distributed configuration file”Â .htaccess is so that users may control authentication. It can also be set in the Apache configuration fileÂ httpd.conf WITHOUT using theÂ .htaccess file. This can improve server performance as the server will not have to look for theÂ .htaccess file in each subdirectory.
- File:Â httpd.conf (portion)
.. ... <Directory /home/domain/public_html/membersonly> AllowOverride AuthConfig AuthName "Add your login message here." AuthType Basic AuthUserFile /home/domain/public_html/membersonly/.htpasswd AuthGroupFile /dev/null require user name-of-user </Directory> ... ..