There are two steps to protecting a folder with a .htaccess file.
Step 1:
Using Notepad (or another text editor), create a file called .htaccess (please note the period). Enter the following text in the file:
AuthUserFile /home/YOURUSER/htpasswd/FOLDER
AuthName “Please enter your username and password”
AuthType Basicrequire valid-user
Replace YOURUSER with your Zenutech username. To find your username, login to the Zenutech control panel, click ‘Account Information”->”Account Summary”. You will find your username in the second column.
Replace FOLDER with the name of the folder you are protecting. For example, if you want to protect www.demo123.com/members, then FOLDER should be changed to ‘members’.
Save this .htaccess file, and upload it into the folder you want to protect. Now when you visit that folder, you will be asked for a username. There still isn’t one setup, though, so keep reading!
Step 2:
Begin by creating a file with the same name as the folder you want protected. This file will hold the usernames and passwords that have access to the folder.
Now, because it wouldn’t be very secure to store the passwords in plain text here, we need to encrypt them. This is done with a tool called ‘htpasswd’, which is available for free on a number of webpages, such as this one. Run each username and password through the tool, and then enter the username with the encrypted password into the file. For example, with username ‘mary’ and password ‘blackpin123′, enter this into the file:
mary:n/KK81Nclh0zQ
Each user should be on a seperate line. On the server, you will need to create a folder in the root of your FTP structure(i.e. /home/USERNAME/) named ‘htpasswd’. Now you can upload the new file to this folder.
All that remains is for you to try it out!