views:

27

answers:

0

Right now I have a server set up for multiple clients: clientA, clientB, clientC.

Each client has their own users.

The way I have it setup is clientA goes to http://www.site.com/clientA and is presented with a login screen which is triggered by an .htaccess file in a directory called /clientA. The .htaccess file has rules which direct Apache to perform database authentication on a table clientA.users.

This works great, but I am aware of the limitations and I would like to set up some rules in the Apache config that accomplish this all without .htaccess files in every directory for every client (gonna get tricky around 100,000 clients for sure!)

Is this even possible? Can I do something like:

RewriteRule ^/(.+)/ Auth_DATABASE = $1

Or do I have to create my own authentication module?

EDIT: So the solution was to create my own module, subclassed from an existing module, and then override the key functions which choose databases. Hope this helps somebody...