6

I am trying to authenticate access to everything in webroot (/) except anything that resides in a particular directory (/directory/) and I've tried both of these options to no avail:

$HTTP["url"] =~ "^(?!(/directory))" {
    auth.require = ( "" =>
            (
            "method" => "basic",
            "realm" => "auth to this area",
            "require" => "user=username"
            )
    )
}

$HTTP["url"] != "/directory" {
    auth.require = ( "" =>
            (
            "method" => "basic",
            "realm" => "auth to this area",
            "require" => "user=username"
            )
    )
}
Nuri Hodges
  • 381
  • 3
  • 12

1 Answers1

4

Try this:

$HTTP["url"] !~ "^/directory" {
    auth.require = ( "" =>
            (
            "method" => "basic",
            "realm" => "auth to this area",
            "require" => "user=username"
            )
    )
}
quanta
  • 50,327
  • 19
  • 152
  • 213