Mod rewrite Lighttpd url重写不起作用
每当我尝试Mod rewrite Lighttpd url重写不起作用,mod-rewrite,lighttpd,Mod Rewrite,Lighttpd,每当我尝试subdomain.localhost/whatever/assets/images/realmeage.jpg时,它会在文件夹/assets/images/realmeage.jpg中显示mir图像,并像一个charme一样工作。同样对于subdomain.localhost/whatever/favicon.ico它显示文件夹/favicon.ico。 但是当我尝试subdomain.localhost/无论什么时,它都不会给我文件夹/sitemap.xml 我还尝试使用debug
subdomain.localhost/whatever/assets/images/realmeage.jpg
时,它会在文件夹/assets/images/realmeage.jpg
中显示mir图像,并像一个charme一样工作。同样对于subdomain.localhost/whatever/favicon.ico
它显示文件夹/favicon.ico
。
但是当我尝试subdomain.localhost/无论什么时,它都不会给我文件夹/sitemap.xml
我还尝试使用debug.log请求处理
(不会重写请求)和debug.log条件处理
(结果:of condition为true)进行调试。有人有线索吗
这是我的lighttpd.conf snipplet(mod_rewrite
已激活)
对不起,我想出来了:
注意:url重写在$HTTP[“url”]条件内不起作用
参见第1.4.34节中固定的
$HTTP["host"] == "subdomain.localhost" {
server.document-root = "folder"
$HTTP["url"] != "test" {
url.rewrite = (
"." => "/sitemap.xml",
)
}
url.rewrite = (
"assets/(.*)$" => "/assets/$1",
"(favicon.ico|sitemap.xml|robots.txt)" => "/$1",
)
}