Monday, December 13, 2010

Using .htaccess for password control of Internet resources

Assigning passwords to protect directories on the servers used by tempusfugit.ca

    .htaccess and .htpasswrd files in the protected directories

The directories as protected by making the appropriate entry in the .conf file for the VirtualSite in question.

  
Directory "/path_to_directory/restricted_directory"
     AllowOverride All
/Directory
Note that the tag delimiters have been removed from the Directory Tag

The contents of .htaccess:

  AuthName "A Dark and Secret Place"
  AuthType basic

  AuthUserFile /path_to_directory/restricted_directory/.htpasswd
  require valid-user

 
The text specified in AuthName is what is displayed in the login dialog below:

No comments:

Post a Comment

Please do not enter links that are just promoting your own website or ones to those that you are shilling.
Comments with hyperlinks (that are not relevant to the original post) will be re-posted or deleted.
Sorry, this is to discourage "blog spam"