j tan()JTAN

Managing your Web Site

Q: How do I password protect a directory in my web site?

Create a ".htaccess" file (chmod 644, maximum) in the directory under public_html that you want to protect. The .htaccess file needs the following directives in it:

AuthType Basic 
AuthName "Some Name Here" 
AuthUserFile /home/yourusername/passwd 
<Limit GET POST> 
require valid-user 

Of course, you need to replace "yourusername" with your actual username.

The next step is to connect to your account with SSH and from the shell prompt use the "htpasswd" command to add users and passwords to the /home/yourusername/passwd file. Just type "htpasswd" at the shell prompt for instructions on how to use that progra m.

The passwd file you create can be anywhere. But it should not be inside your public_html directory.

FAQ Table of Contents

Services  |  Resources  |  Contact  |  News  |  Members  |  Signup


() Copyright © 1991-2014
All rights reserved
All use of this site subject to terms.