|jump to another section
To give password protection to a directory, you first need to create a file called ".htaccess" in the directory to be protected. The contents of this file should be something like:
AuthName "photo gallery"
Change the AuthUserFile to where you want to keep the password list (typically in your home directory), and change AuthName to what you want as the title of the pop-up window asking for the username/password. Be sure to use ASCII mode when transferring this file in ftp.
Next, generate encrypted passwords for all users of this private directory. This can be done here. Cut and paste its output into your .htpasswd file to add accounts. For example, the username test with password test would look like: test:teH0wLIpW0gyQ
Users should be added one per line. Remember to use ASCII mode for this file too.