hosted by liquidweb

Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : creating an .httpaccess file

Forum Jump

creating an .httpaccess file

Reply Post New Thread In Programming Discussion Subscription
Send news tip View All Posts Thread Tools Search this Thread Display Modes
New Member
Join Date: Aug 2004
Posts: 2

creating an .httpaccess file

Hello everyone,

I'm trying to set up username and password access to a website I am developing. I've never done this before, and I understand that I will need to create an .httpaccess file, but I can't find any information on how to do this anywhere. If someone could point me in the right direction or give me some pointers, I would be very grateful!


Sponsored Links
Join Date: Aug 2004
Posts: 22
google .htaccess

Join Date: Jan 2004
Location: Greece
Posts: 2,072
As Radchenko said it's .htaccess and not .httpaccess.

First create the file with the passwords:

htpasswd -cmdps auth UserName

Then create the .htaccess file:

AuthType Basic
AuthName "The Admin Control Panel"
AuthUserFile /path/www/auth
require user UserName


Sponsored Links
New Member
Join Date: Aug 2004
Posts: 2
Thanks guys! One more question, though - how do I know what path I should be using for AuthUserFile /path/www/auth?

My guess would be that it is /path/www/HTML/ross

("ross" is the folder I need to password-protect).

Any thoughts? Do I always use the word "path", or should that be replaced? I've submitted a help ticket to my host, but in the meantime...

Junior Guru Wannabe
Join Date: Jun 2004
Location: Bristol UK
Posts: 33
The advice above is spot on, but assumes you have shell access. Ideally you should login to your server using an SSH client like Putty.

Once logged into your file system, you need to create a password file. This file holds the list of authorised users and encrypted passwords.

htpasswd -cmdps auth UserName

The above is one method, but for a fuller explanation simply type - htpasswd at the prompt and study the options and appropriate syntax.

You should place the password file in a place not accessible from the web. ie.

/var/ross/www/public or /home/sites/ are both accessible from the web so place your password file here:

/var/ross/.htpasswd or /home/sites/

The .htpasswd file is automatically generated using the htpasswd command. By default the htpasswd file is dropped in the folder where you execute the htpasswd command from the command line.

Now you have a password file located behind the site root, simply reference it in any number of .htaccess files. By placing a .htaccess file in a folder, it becomes password protected.

Combining the examples the .htaccess files should look like this:

AuthType Basic
AuthName "The Admin Control Panel"
AuthUserFile /home/sites/
require user UserName

If you have any problems, PM me and I will walk you through it.

If nothing changes - Everything stays the same!

E-Business Hosting Ltd.
United Kingdom


Related posts from
Title Type Date Posted
Dutch File-Sharing Company WeTransfer Raises $25M to Expand in US Web Hosting News 2015-02-20 13:43:00
Dropbox Suffers Temporary Outage Impacting File Sharing and Synchronizing Web Hosting News 2014-03-14 12:11:46
AeroFS Launches Private File Sharing Software Web Hosting News 2013-11-22 17:00:53
Egnyte Launches Program to PRISM-Proof Enterprise Cloud File-sharing Web Hosting News 2013-09-27 13:45:48
File Sharing Site Rapidshare Cuts 45 Jobs as Traffic Declines Web Hosting News 2013-05-17 16:03:15

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Log in with your username and password

Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Web Hosting News:
WHT Membership
WHT Membership



Welcome to

Create your username to jump into the discussion! is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.

(4 digit year)

Already a member?