Using .htaccess for password protecting your folders
If you need to have certain areas (folders or files) of your web site protected you can use .htaccess and .htpasswd files to enable a basic user/pass protection.
The Apache web server provides a quick and easy way to protect a file or folder on your site.
The password protection depends on two files. The first one is the .htaccess file. It tells the webserver that viewing the file and/or folder requires authorization. The second file is the .htpasswd file it stores information about the users and their passwords. Its content will look similar to the following…