I posted this early yesterday but I fear I haven’t
gotten a response due to my unclear explanation, sorry if I am being a pain…… Setup: Apache 1.3.34 on Win32 We have a basic authentication setup that requires separate
set of users to log in to separate sites. As you can see from the setup below
we are separating authentication by site. This can be tedious as we create and
remove sites quite frequently. We want to implement one authorization line that
will match site to AuthUserFile. We want to avoid having to add Authentication
directive for every site created going forward. Is there a way to use something
like regular expressions and LocationMatch to have Apache automatically match
the site to the authentication file? IE: User logs to site 2, Apache
automatically routes to authentication file ...
"c:\data\configurations\users2.txt". I have tried doing the following
with no success… <LocationMatch "/live/.*/"> AuthType Basic AuthName "Enter
Password:" AuthUserFile c:\data\configurations\$1\users.txt Thank you in advance. ....................... Alias "/site1"
"c:/data/live/site1" <Location "/site1"> AuthType Basic AuthName "Enter
Password:" AuthUserFile
c:\data\configurations\site1\users.txt Require valid-user </Location> Alias "/site2"
"c:/data/live/site2" <Location "/site2"> AuthType Basic AuthName "Enter
Password:" AuthUserFile
c:\data\configurations\site2\users.txt Require valid-user </Location> Alias "/site3"
"c:/data/live/site3" <Location "/site3"> AuthType Basic AuthName "Enter
Password:" AuthUserFile
c:\data\configurations\site3\users.txt Require valid-user </Location> Christian Toledo |