FREQUENTLY ASKED QUESTIONS

Return To FAQ

Password Protection of Web Pages and/or Directories
How to restrict access to certain subdirectories of your site
First, this is not for everyone, it is advanced HTML and Webpage Design. Please do not email me, the webmaster, to ask how to set this up. All the information you need can be found here or here, the NCSA Tutorials.
-------------------------------------------------------------------------

For Username/Password verification:
Create two files (.htaccess and .htpasswd). Place the .htaccess file in the directory you wish to protect (if a .htaccess file already exists, edit it, but DO NOT delete it). Place your .htpasswd file in the not_public folder. To create the contents of the .htpasswd file, click here. Replace the word "username" with your actual username or login name.

---------BEGIN .htaccess----------------


AuthUserFile /home/username/not_public/.htpasswd
AuthGroupFile /dev/null
AuthName PasswdProtection
AuthType Basic

<Limit GET>
require user username username2
</Limit>

---------END .htaccess------------------
Where Directory-name is the directory that has the .htpasswd file in it. Example of the .htaccess:
AuthUserFile /home/username/not_public/.htpasswd
AuthGroupFile /dev/null
AuthName PasswdProtection
AuthType Basic

<Limit GET>
require user guest
</Limit>

----------BEGIN .htpasswd---------------
username:vVwRCi7IZaYpw
username2:j7lNkSu1V2rtI

----------END .htpasswd-----------------
You can create the username:passwd information by clicking here.
-------------------------------------------------------------------------
For Location Restricting:

Create an .htaccess file, then limit access to any
hostname or domain. In this example, only hosts in drw.net can
retrieve documents from this directory.
---------BEGIN .htaccess----------------
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName DomainRestriction
AuthType Basic

<Limit GET>
order deny,allow
deny from all
allow from .drw.net
</Limit>

---------END .htaccess------------------

This is all you need to restrict access to a directory; however, if you want more information, you can clickhere to see the official NCSA httpd documentation on .htaccess files.

 

Looking for a Domain Name?
CLICK HERE TO START
250 MB Diskspace
10 GB Transfer
25 Email Accounts
Intel 1.7 GHz
256 MB RAM
1 IP Address
25 GB Transfer
ULC-3 Secure
1U to Full Tower
Copyright 2004. DRW Networks Inc. All Rights Reserved
Quick Links: Small Business Web Hosting | Dedicated Servers | Colocation | Resellers | Design | Support | About