|
Posted by Rik on 10/23/06 23:00
laredotornado@zipmail.com wrote:
> I have seen .htaccess files, but how can they be built so that they
> read from a database of stored username and passwords?
That's not that simple.
You could make .htpasswd files on the fly, but that's hardly preferable, as
you'll have to create, maintain and verify the file on every change in
users.
What I'd do:
create a .htaccess file:
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !^accesscontrol.php
RewriteRule ^(.*?)$ accesscontrol.php?file=$i&%{QUERY_STRING} [NC,L]
And handle authentication in accesscontrol.php, and possibly include the
requested files, or give a Unauthorised header.
--
Grtz,
Rik Wasmus
[Back to original message]
|