Create .htpasswd file with username
htpasswd -c .htpasswd username
Add additional username to .htpasswd file
htpasswd .htpasswd username
Groups
.htgroup file: it: user1 user2 user3 admin: user4 user3 boss: user3
Group Access
.htaccess file: AuthUserFile /full/path/to/.htpasswd AuthGroupFile /full/path/to/.htgroup AuthType Basic AuthName "Password Protected Directory" <Files "mypage.html"> Require group it </Files> <Files "myotherpage.html"> Require group admin </Files> <Files "myotherotherpage.html"> Require group boss </Files>
Single Directory
.htaccess file: AuthUserFile /full/path/to/.htpasswd AuthType Basic AuthName "Password Protected Directory" Require valid-user
Multiple Files
.htaccess file: AuthUserFile /full/path/to/.htpasswd AuthType Basic AuthName "Password Protected File" <Files "mypage.html"> Require valid-user </Files> <Files "myotherpage.html"> Require valid-user </Files>
Exempt Inside Directory From Password Protection
.htaccess file: Allow From All Satisfy Any