我正在尝试验证对 webroot 中所有内容的访问权限 (/) 除了位于特定目录 (/directory/)并且我尝试了这两个选项但都无济于事:
$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"
)
)
}
答案1
尝试这个:
$HTTP["url"] !~ "^/directory" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "auth to this area",
"require" => "user=username"
)
)
}