Password protect a directory using htaccess and htpasswd
Here is how you can password protect a directory using htpasswd and .htaccess files:
Next, edit/create an .htaccess file in the same directory containing:
NOTE: A absolute path is required for the AuthUserFile directive.