天空小小岛技术网站
标题:
lighttpd 的 Discuz! rewrite 规则 bug 及解决方案
[打印本页]
作者:
一粒米
时间:
2009-10-12 21:33
标题:
lighttpd 的 Discuz! rewrite 规则 bug 及解决方案
原来想得很简单,以为这样写就可以了。
错误的:
url.rewrite-once = (
"^/archiver/((fid|tid)-[\w\-]+\.html)$" => "archiver/index.php?$1",
"^/forum-([0-9]+)-([0-9]+)\.html$" => "forumdisplay.php?fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "viewthread.php?tid=$1&extra=page%3D$3&page=$2",
"^/space-(username|uid)-(.+)\.html$" => "space.php?$1=$2",
"^/tag-(.+)\.html$" => "tag.php?name=$1"
)
复制代码
结果发现帖子那个 $3 一直传不进去,认真看了一下 lighttpd 的 rewrite 文档
http://trac.lighttpd.net/trac/wiki/Docs%3AModRewrite
结果发现 %3 表示的是 subdomain 1 name ,也就是说在语法中写这个,不被当成字串来识别
既然这样,那么就在 % 和 3 之间放置一个空的值以分隔开它们并且不影响最终转换的值。
我是这么写的
正常可用的:
url.rewrite-once = (
"^/archiver/((fid|tid)-[\w\-]+\.html)$" => "archiver/index.php?$1",
"^/forum-([0-9]+)-([0-9]+)\.html$" => "forumdisplay.php?fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "viewthread.php?tid=$1&extra=page%%53D$3&page=$2",
"^/space-(username|uid)-(.+)\.html$" => "space.php?$1=$2",
"^/tag-(.+)\.html$" => "tag.php?name=$1"
)
复制代码
欢迎拍砖。
欢迎光临 天空小小岛技术网站 (http://tkxxd.net/)
Powered by Discuz! X3.1