Missouri Website Design, Website Maintenance, and Graphic Design by Blue Buffalo Media - Buffalo, MO

Photography and Graphics by Blue Buffalo Media Website Design and Graphic Design

HOW TO: Configure htaccess / htpasswd security on GoDaddy.com

Anyone who has tried to do this on GoDaddy hosted sites, most likely had the same problems as I and a million other people had.

Here is how to enable .htaccess and .htpasswd security on a web site hosted on GoDaddy.com.

Assuming you have a hosted web site (www.mysite.com), which you connect to using the FTP username "friends", you should create the following .htaccess file in the directory where you want to protect by password (in this example this is "/html/" folder - first and main root directory on your hosting account):

------- begin .htaccess file -------
AuthUserFile /home/content/F/R/I/FRIENDS/html/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>

-------- end .htaccess file -----------

YOU SHOULD replace the capital "F/R/I/FRIENDS" with lowercase versions of the first three letters of your "username" followed by your whole "username". This path is the absolute path you see when you first log in to your FTP site, and the root directory of www.mysite.com.

Then you should create a ".htpasswd" file using the Apache "htpasswd" utility or one of the many internet .htpasswd generators, and save it at the location you specified above ( in .htaccess file in our example is /html/ main root directory ).

The format for .HTPASSWD file is :

1 secretlogin:seZLrnR9h3sls

... where is "seZLrnR9h3sls" means "secretpassword" - word scripted and generated using the Unix <crypt> command.

Download a simple Windows application that allows user names and passwords to be encoded into a format suitable for use with UNIX systems, in particular for the Apache web server running on UNIX to restrict access to your web site to authorised users. This allows new users to be added to the .htpasswd file locally on the PC, without needing to run a script while online to encode the passwords. Once updated, the file will still need to be FTP'd to your web site.

Make sure to rename your htaccess and htpasswd files on your server. Remove the .txt extension and put a period before the file name. Example: .htaccess and .htpasswd

That is all.

 

 Home | Website Design | Graphic Design | About | Contact | Sitemap | Links