Web Site with .htaccess Files
Put a plain text file named .htaccess (the period is important!) in the directory you wish to protect with contents like this:
The AuthUserFile directive names the directory and file that contains all of the username and password information for your site. The directory should not be the same as for any of your web pages. For security reasons, put the AuthUserFile in a directory that is not "published" by the Web Server. Generally, this means don't put the AuthUserFile anywhere in or below your public_html directory.
AuthName "Title of Your Page Used in Password Dialog Box"
< Limit GET POST >
require user username1 username2 username3 ...
< /Limit >
The AuthName directive should be a title that indicates the nature of the content in the protected directory. The Netscape browser (Communicator 4.0) pops open a dialog box that says "Enter username for at www.domain.tld", for example. The "require user" line specifies which usernames from your password file are allowed to access this directory. Note that if you password-protect a directory, all directories below it should be automatically password-protected unless they are accessible to the web server by other logical paths.
Setting up Your Password File
Change directories to the directory where you currently store (or want to store) your password file. If password-file already exists, then issue the commands: htpasswd PasswordFilename username
Then, enter the user's password twice as prompted. A line will be added to the PasswodFile with the new user and their encrypted password.
If password-file does not exist yet (this is the first entry for password-file ), then simply issue the command: htpasswd -c password-file username The -c option causes a new Password File to be created. If the Password file already exists, do not use the -c ("create") option, because it will wipe out any existing users' lines in the file.
This should successfully add a user and encrypted password to your AuthFile.
What Different Fonts Are
Available in HTML?
We have provided a font reference page for your convenience which lists a large and growing number of fonts using the HTML FONT FACE="font name" tag. Not all fonts are available on all platforms.
What Different Colors Are
Available in HTML?
We have a HTML colors reference page for your convenience too.