How to create a members only login area on a website

Written by jason spidle Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to create a members only login area on a website
Creating a members only section is easiest using .htaccess files. (padlock image by dinostock from Fotolia.com)

The most common and easy way to create a members only login area is to password-protect a directory using a hypertext access (.htaccess) file. This file resides within the directory you wish to make members only and will prompt users attempting to access a specific directory for a username and password. When someone attempts to access any file within that directory, the .htaccess file instructs the browser to only allow the website to be displayed if the correct username and password are entered. You can set-up an .htaccess file to work with as many username and passwords as you require.

Skill level:
Moderately Easy

Other People Are Reading

Things you need

  • .htaccess file with password protection

Show MoreHide

Instructions

  1. 1

    Launch Notepad by selecting "Start," "Programs," "Accessories," "Notepad.

  2. 2

    Enter the following into the empty worksheet replacing DIRECTORY with the web directory you wish to password protect: AuthName "Restricted Area" AuthType Basic AuthUserFile /DIRECTORY/.htpasswd AuthGroupFile /dev/null require valid-user

  3. 3

    Save the file as ".htaccess" without quotations and without a filename preceding the extension.

  4. 4

    Upload this document into the directory you wish to password protect.

  5. 5

    Create a new blank document in Notepad by selecting "File," "New."

  6. 6

    Generate username and encrypted password combinations using a web-based password generator (see Resources).

  7. 7

    Copy and paste the username and passwords into the blank Notepad document.

  8. 8

    Save the file as ".htpasswd" without quotations and without a filename preceding the extension.

  9. 9

    Upload this document into the directory you wish to password protect. The directory will now prompt users attempting to access the website for a username and password as provided in the .htpasswd file.

Tips and warnings

  • Most freely available content management systems (CMS) like WordPress, Joomla and Drupal offer easy to use tools for creating members only login areas for a website. These tools function as add-ons to the base structure of the CMS and can be configured with very little knowledge of hypertext access files and databases.
  • Creating a large scale members only website with hundreds or even thousands of individual accounts will require a more robust solution than .htaccess files. Most likely, it will be necessary to install commerce software that links to a database to manage the creation of usernames and passwords. Implementing a large scale members only website is highly technical and will require the services of a trained web professional.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.