我需要在lighttpd中将https://www.mysite.com/folder/subfolder重定向到https://www.mysite.com/folder/。我尝试过以下方法:
$HTTP["host"] =~ "https://www.mysite.com/folder/folder" {
url.redirect = (
".*" => "https://www.mysite.com/folder/"
)
}
但它不起作用。
有人可以告诉我Lighttpd中的正确语法吗?
感谢。
答案 0 :(得分:1)
这可能是因为mod_redirect模块不可用(默认情况下通常会禁用)。
<强>的modules.conf 强>
server.modules = (
"mod_access",
"mod_proxy",
"mod_accesslog",
# "mod_alias",
# "mod_auth",
# "mod_evasive",
"mod_redirect",
"mod_rewrite"
# "mod_setenv",
# "mod_usertrack",
)
<强> lightttpd.conf 强>
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ "^subdomain.server.com" {
url.redirect = (".*" => "https://%0$0")
}
}