繁体   English   中英

用PHP MVC重写Lighttpd URL

[英]Lighttpd url rewrite with php mvc

我希望将root/cvideo/...上的所有请求重新路由到root/cvideo/index.php ,问题出在js和css上,这也得到路由,这是我能做的最好的...

url.rewrite-once = ( "/(js|jpg|css|)/$"=>"$0",
                     "^/cvideo([^?])*$"=>"/cvideo/index.php" )

我的正则表达式似乎是regit,但是每当我访问js或CSS文件时,它都会导致404错误,其他部分工作正常。 救命? 请?

您的正则表达式模式有点错误:

url.rewrite-once = (
    "^.*\.(js|jpg|css)/?$" => "$0",
    "^/cvideo" => "/cvideo/index.php"
);

请注意,我不知道lighttpd如何处理$0组,这就是为什么我在模式中添加.*的原因。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM