Page 1 of 1

htaccess question

Posted: Wed Aug 25, 2004 6:06 am
by lazersam
Hi all
Ive been stuck on this for ages! Although I have found related posts I still cant figure this one out! I want to protect a directory with .htaccess because it contains ebooks for my members to download. Can anyone give an example of what the htaccess code will look like when calling for authorisation from a mysql?

Also, do you know what chmod to set the protected directory?

Thanks

Larry.

Posted: Wed Aug 25, 2004 7:29 am
by Weirdan
well, there's mod_auth.mysql mentioned here and there around the net, but all links appears to be dead.
Alternatively, you could have 'Deny from all' htaccess in your protected directory in conjunction with php script set as error page for 'forbidden' error which checks the $_SERVER['HTTP_AUTH_USER'] and $_SERVER['HTTP_AUTH_PW'] against the database (and outputs requested document if access is allowed).