Welcome to WebmasterWorld Guest from 54.163.52.98

Forum Moderators: bakedjake

Message Too Old, No Replies

Restricted directory

how to setup

     

Trusty

9:58 am on Feb 27, 2003 (gmt 0)



Hello folks!

How and where in apache setup restricted directory.
Example: when user click to restricted dir. must appear login window
let's say www.widgets.com/members/ ==>> so members area is restricted directory, under this directory I'll use .htaccess,.htpasswd.
Sorry for bad English.

Thanks for any help.

Have a nice day :)

hakre

10:31 am on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi trusty,

you'll need both files for. the .htaccess to tell the webserver that a specific directory is restricted (i.e. the current one) and a .htpasswd file in which the username(s) and password(s) are stored.

in the .htaccess file place the following text:


AuthType Basic
AuthName "restricted"
AuthUserFile .htpasswd
require valid-user

in the .htpasswd file you put username and password seperated by a : (double-point). the password is encrypted. you can use a commandline tool or an online tool (look for .htpasswd and crypt) to encrypt your password. that's all.

martin

1:20 pm on Mar 1, 2003 (gmt 0)

10+ Year Member



If you have Satisfy Any in a parent directory you'll also have to add Satisfy All in the protected one.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month