Welcome to WebmasterWorld Guest from 54.167.46.29

Forum Moderators: bakedjake

Message Too Old, No Replies

Restricted directory

how to setup

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

Junior Member

joined:Sept 1, 2002
posts:57
votes: 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 :)

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 7, 2003
posts:1230
votes: 0


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.

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

Preferred Member

10+ Year Member

joined:Aug 3, 2002
posts:482
votes: 0


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