Regex 重定向Lighttpd中除一页以外的所有页面
如何将lighttpd web服务器上除一个页面外的所有页面重定向到HTTPS?我提出了以下内容,但它仍然重定向“/report.cgi”-我假设是因为第二个重定向条件覆盖了第一个重定向条件:Regex 重定向Lighttpd中除一页以外的所有页面,regex,redirect,lighttpd,Regex,Redirect,Lighttpd,如何将lighttpd web服务器上除一个页面外的所有页面重定向到HTTPS?我提出了以下内容,但它仍然重定向“/report.cgi”-我假设是因为第二个重定向条件覆盖了第一个重定向条件: # redirect HTTP server.modules += ( "mod_redirect" ) $HTTP["scheme"] == "http" { $HTTP["host"] =~ ".*" { url.redirect = ( "^/repor
# redirect HTTP
server.modules += ( "mod_redirect" )
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (
"^/report\.cgi$" => "http://%0$0",
"^/.*$" => "https://%0$0"
)
}
}
我需要这个,因为嵌入式设备应该能够通过HTTP与我的web服务器联系。多亏了,我想出了以下解决方案:
# redirect HTTP
server.modules += ( "mod_redirect" )
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (
"^/(?!report.cgi).*" => "https://%0$0"
)
}
}
多亏了,我想出了以下解决方案:
# redirect HTTP
server.modules += ( "mod_redirect" )
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (
"^/(?!report.cgi).*" => "https://%0$0"
)
}
}