Add Password Protection to any Folder with .htaccess file
In order to do that you need to do 2 things:
1) Edit .htaccess file
2) Generate sh1 hash key for your password.(use this page to generate sh1 passwosh hash)
2) Add it to .htpass file (all user and hashed-password) and upload to server.
1) Add the following lines to your .htaccess file:
AuthName "restricted area"
2) Create .htpass file with the following format and upload it to the same folder you want to add protection to: