jump to navigation

This is NOT the official website of AvantBiz Consulting Limitd but just some casual discussions about various topics. Please visit www.avantbiz.com if you need our professional services.

Use .htaccess to restrict access to web pages October 16, 2006

Posted by klyuen in : Computer 電腦,Linux,Web 網頁 , trackback

This document demonstrates the use .htaccess to restrict access to web documents by user and password.

 

The Restricted Access Document

The document “Restricted Information” is only available to user john with password orange and user sheri with password apple. The first time you click on “Restricted Information”, your web browser should prompt you for a user name and password. If it does not you may be using a web browser which is not HTTP authentication capable. 


Ingredients

NOTE: Please make sure you are setting this up in the directory that you want passwd protected. The .htpasswd file will end up in the wrong directory otherwise. For more infomation on how to use Unix, please check out our Unix Tutorial.

NOTE: There is no correspondence between the usernames and passwords used for accounts on this server and usernames and passwords in any specific .htpasswd file. A user doesn’t need to have an account on this system in order to be validated for access to files protected by HTTP-based authentication.

Comments»

no comments yet - be the first?