start learning

protect a directory using htaccess

How to protect a directory using htaccess ?

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user

This directive protects a directory with basic HTTP authentication. Users will be prompted to enter a username and password to access the directory. You'll need to create an .htpasswd file containing the username and password information for authorized users.