是否有一种与莱特普中的特定模式相匹配的密码保护URL的方便方法?
我考虑过匹配regex,但是任何其他创造性的解决方案都会很好。
注意到:我不是在寻找密码保护目录的方法,因为我想要保护的URL并不局限于特定的目录结构。
亚当
发布于 2010-02-07 17:24:35
你看过mod_auth
插件了吗?
auth.debug = 0
auth.backend = "plain"
auth.backend.plain.userfile = "/full/path/to/auth-file.txt"
auth.require = ("example.com" =>
(
"method" => "basic",
"realm" => "Password protected area",
"require" => "user=username"
)
并且auth文件将包含(用于基本身份验证):
username:password
更多信息:http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModAuth
若要筛选/检查特定目录,
$HTTP["url"] =~ "^/download(s)?$" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "Passworded Area",
"require" => "user=username"
)
)
}
https://stackoverflow.com/questions/2171922
复制相似问题