![]() |
![]() |
![]() |
You Are Here: Home : cape.computing : Developers' Info |
|||
|
|
User Authentication with htaccess
Web-based authentication denies web access to visitors who do not give a valid username and password. This feature allows webmasters to restrict access to certain directories. The usernames and encrypted passwords are maintained by the webmaster and can be edited from the command line, or, via a cgi script. ExampleAssuming we want to protect the directory, public_html/admin/
The .htaccess file affects the directory in which it is placed, so in this example, any visitor requesting http://mydoamin.com/admin/ would be presented with an authentication request. The .htaccess file also affects directories recursively below it. Therefore, requesting http://mydoamin.com/admin/somepath/ would yeild the same authentication request unless /home/myusername/public_html/cgi-bin/admin/somepath had a .htaccess file of its own. The first line, starting with AuthUserFile, tells the webserver where to find your username/password file, and, identifies its file name. The AuthName in the example, "Welcome to MyDomain.com" is presented to the visitor and used in the authentication request. Related PagesHaving SSH/Telnet access to your site is a must if you'll be developing customized CGI scripts.
The information presented in this section is deemed accurate but is
not guaranteed. It is provided as a free service to our subscribers
and clients. Additionally, Cape.Com, Inc. exercises no editorial control
over any links that are outside the www.cape.com domain and the content
of these sites does not necessarily represent the views and opinions
of our Company, its employees or clients.
|
|
|
||