There are several ways that you can make part of a web site accessible only to those who have a valid username and password. One of the easiest and most flexible methods is to use an
.htaccess file. If your web server software is Apache (or similar flavor), these files can be used for a variety of purposes like custom 404 error pages, URL redirection, directory indexes, password protection, etc.
http://resma.net/tutorials/htaccess.php has a nice tutorial on setting up a password protected directory. You create the .htaccess file which contains instructions to the server about that directory. You create an .htpasswd file which contains the usernames and passwords. There is an online tool that you use to create the encrypted passwords for that file. If you simply put in plain text for the passwords, then you're going to have problems.
Hope this helps.