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
Launch Notepad by selecting "Start," "Programs," "Accessories," "Notepad.
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
Save the file as ".htaccess" without quotations and without a filename preceding the extension.
Upload this document into the directory you wish to password protect.
Create a new blank document in Notepad by selecting "File," "New."
Generate username and encrypted password combinations using a web-based password generator (see Resources).
Copy and paste the username and passwords into the blank Notepad document.
Save the file as ".htpasswd" without quotations and without a filename preceding the extension.
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.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for