httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin 't Hart" <co...@sharpheart.org>
Subject Re: [users@httpd] protecting a list of specific urls
Date Fri, 25 Oct 2013 12:08:28 GMT
Hi Edward,

You do know that Location supports regular expressions? You should be able
to collapse all 3 into a single Location something like the following:

<Location ~ "^/(site1/abc|site2/tux|site3/zzz)">
        AuthType Basic
        AuthName "Administrators"
        AuthBasicProvider ldap-centos
        Require valid-user
</Location>

See http://httpd.apache.org/docs/current/mod/core.html#location

Cheers,

Colin


On 25 October 2013 12:37, Edward Quick <edwardquick@hotmail.com> wrote:

> Hi group,
>
> I have a list of specific urls I want to protect, for example:
>
> /site1/abc
> /site2/tux
> /site3/zzz
>
> which I can configure in separate location blocks like below and that
> works fine. However I was wondering if there is a simpler way I can do this
> like a url whitelist file instead?
>
> Thanks,
> Ed
>
> <Location /site1/abc>
>         AuthType Basic
>         AuthName "Administrators"
>         AuthBasicProvider ldap-centos
>         Require valid-user
> </Location>
>
>
> <Location /site2/tux>
>         AuthType Basic
>         AuthName "Administrators"
>         AuthBasicProvider ldap-centos
>         Require valid-user
> </Location>
>
> <Location /site3/zzz>
>         AuthType Basic
>         AuthName "Administrators"
>         AuthBasicProvider ldap-centos
>         Require valid-user
> </Location>
>
>

Mime
View raw message