Frequently Asked Questions

Help Center Search

Using .htpasswd with Your Linux Shared Hosting Account

Print this Article
Comment on this Article
Last Updated: October 6, 2008 4:28 PM

To protect a directory in your hosting account with a password, in that directory, create an .htaccess file that contains the following:

AuthUserFile /home/content/l/o/g/login_name/html/.htpasswd
AuthGroupFile /dev/null
AuthName "EnterPassword"
AuthType Basic

require valid-user

Where "l," "o," and "g" are the first three letters of your hosting login and "login_name" is your full hosting login. For example, the hosting login "maynard" would translate to the following path:

/home/content/m/a/y/maynard/html/.htpasswd

The AuthUserFile describes where the Web server looks for the .htpasswd file. The .htpasswd file contains a list of users who have access to a protected directory and their hashed passwords. There are a number of tools available online to create .htpasswd files.

NOTE: Due to server caching, new .htaccess files may take up to one hour to be recognized. Changes to existing .htaccess files are picked up immediately.

NOTE: Our servers are configured to prevent the downloading of both .htaccess and .htpasswd files.