Intrex Internet Services


Directory Access Control

In order to password-protect access to individual directories of your website, a simple directory access control method can be employed.

Note: Your account must be hosted on the UNIX webserver in order to use this access control method.  If you are unsure which server your account is hosted on, please contact technical support.  Switching from one server to the other is as simple as an emailed request to update@intrex.net.  Please be aware that if you use Active Server Pages (ASP) or FrontPage Server Extensions, these are not currently supported by our UNIX webserver.  Most users do not use this functionality.

  1. Ensure that you are hosted from the UNIX webserver.
  2. With Windows Notepad (or your text editor of choice), create a file named .htaccess (note the period before the name) with contents similar to this:
    AuthName "Restricted Access"
    AuthType Basic
    AuthUserFile /home/[username]/www/[protected-directory]/.htpasswd
    Require valid-user
    Satisfy All
    Where [username] is the username you use to access the server via ftp, and [protected-directory] is the directory of your site you wish to protect.
    For more information about available options in the .htaccess file, please consult the Apache Documentation.
  3. Download the htpasswd.exe utility from our website.
  4. Save the htpasswd.exe to the C:\Windows directory (or C:\WinNT in Windows 2000).
  5. Note: Alternatively you may download and install the Apache HTTP server package from The Apache Project, which contains htpasswd.exe.  The remaining instructions presume that you downloaded the htpasswd.exe directly from our website at the link above.
  6. Open a DOS box:
    1. Click Start, then click Run.
    2. In the resulting box, type in: command
      Note: In Windows 2000/XP cmd is preferable.
    3. Click "Ok" or press "Enter" on your keyboard.
    4. This should produce a box with white text on a black background.
  7. Use the following command to create a .htaccess file:
    htpasswd -c C:\.htpasswd <username>
    Replace <username> with the username you want to access the site as. This will prompt you (twice) for a password for the username you entered. Enter it twice and the file will be created in the C:\ directory, and the username added to it.
  8. To add additional users to the file, use this command:
    htpasswd C:\.htpasswd <username>
  9. Use FTP to upload both the .htaccess and .htpasswd files to the server, into the directory you wish to protect. Any usernames added in Steps 9 and 10 will be able to access the directory with the appropriate username and password combination.
  10. Enjoy!


Return to Technical Support

Home