0

In the document root of my web server (Apache 2.2.15 on CentOS 6.0) I have an /index.php script, which I'd like to be password protected and then few helper scripts (/helper1.php, /helper2.php, ...) which actually shouldn't be password-protected - because they are sometimes used directly (for example "hotlinked" from some Excel spreadsheets).

At the moment I have every script password-protected:

<Location />
        AuthType basic
        AuthName "My Protected Area"
        Require valid-user

        AuthBasicProvider ldap
        AuthzLDAPAuthoritative  Off
        AuthLDAPURL             "ldap://ldap-server.XXX.com/OU=Users,DC=XXX,DC=com?sAMAccountName?sub?(objectClass=user)"
        AuthLDAPBindDN          afarber@XXX.com
        AuthLDAPBindPassword    XXXXXX
</Location>

Can anyone please suggest me a way, how to keep /index.php password-protected, but at the same time do not require entering a password when using /helper1.php, etc.?

Thank you! Alex

Alexander Farber
  • 714
  • 4
  • 17
  • 38

1 Answers1

0

For any php script you don't want to protect, put a Satisfy Any in Location directive. You can also use LocationMatch, something like this:

<LocationMatch "/helper(1|2).php">
    Satisfy Any
</LocationMatch>
quanta
  • 51,413
  • 19
  • 159
  • 217