Ok, so I have the .htaccess file that looks like this placed in the directory I want to password protect. AuthName "Secure Area" AuthType Basic AuthUserFile /path/to/your/directory/.htpasswd require valid-user Now I used the .htpasswd command and got that file created but now what do I do ? Thanks. P.s I am using windows apache version 2.2.8
The htpasswd command is used to create a password file (can be any name) and add the username + password to this file. Once you've done that and added the "require username" line in your .htaccess, that should be enough and you should get a prompt when you try to access this area from your browser.
Alternatively, you can use an online generator to create your htpasswd file. Check the one on Joe's web tools: htpasswd generator
Place the file somewhere safe and readable by Apache, then add that path in place of the one in this line from what you posted. AuthUserFile /path/to/your/directory/.htpasswd Code (markup): For instance AuthUserFile "c:/www/auth/.htpasswd" Code (markup):