By烟花易冷

Lighttpd下Discuz系列论坛伪静态规则
2014-02-13

下面来说说Discuz系列论坛在lighttpd下的伪静态规则,怎么使用我就不多说了吧(PS:不懂的看看上一篇文章撒)

1、首先放上来的是最多人使用的Discuz X2.5的伪静态规则:

url.rewrite-once = (
“^(.*)/topic-(.+)\.html$” => “$1/portal.php?mod=topic&topic=$2”,
“^(.*)/article-([0-9]+)-([0-9]+)\.html$” => “$1/portal.php?mod=view&aid=$2”,
“^(.*)/forum-(\w+)-([0-9]+)\.html$” => “$1/forum.php?mod=forumdisplay&fid=$2&page=$3”,
“^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$” => “$1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3”,
“^(.*)/group-([0-9]+)-([0-9]+)\.html$” => “$1/forum.php?mod=group&fid=$2&page=$3”,
“^(.*)/space-(username|uid)-(.+)\.html$” => “$1/home.php?mod=space&$2=$3”,
“^(.*)/blog-([0-9]+)-([0-9]+)\.html$” => “$1/home.php?mod=space&uid=$2&do=blog&id=$3”,
“^(.*)/(fid|tid)-([0-9]+)\.html$” => “$1/index.php?action=$2&value=$3”
)

2、然后是Discuz X2.0 的伪静态规则,我好像发现还真有那么一些论坛依旧是Dz X2

url.rewrite-once = (
“^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$” => “/404.php”,
“^(.*)-htm-(.*)$” => “$1.php?$2”,
“^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$” => “$1/show.php?itemid=$2&page=$4”,
“^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$” => “$1/list.php?catid=$2&page=$4”,
“^(.*)/show/([0-9]+)/([0-9]+)?([/])?$” => “$1/show.php?itemid=$2&page=$3”,
“^(.*)/list/([0-9]+)/([0-9]+)?([/])?$” => “$1/list.php?catid=$2&page=$3”,
“^(.*)/([a-z]+)/(.*)\.shtml$” => “$1/$2/index.php?rewrite=$3”,
“^(.*)/com/([a-z0-9_]+)/([a-z]+)/(.*)\.html$” => “$1/company/$3/index.php?homepage=$2&rewrite=$4”,
“^(.*)/com/([a-z0-9_]+)/([a-z]+)([/])?$” => “$1/company/$3/index.php?homepage=$2”,
“^(.*)/com/([a-z0-9_]+)([/])?$” => “$1/company/index.php?homepage=$2”
)

3、最后是老旧老旧的Discuz 7.2的伪静态规则,别小看了DZ7,这个版本好食好令人怀念的哦

url.rewrite-once = (“^(.*)/archiver/([a-z0-9\-]+\.html)$” => “$1/archiver/index.php?$2”,
“^(.*)/forum-([0-9]+)-([0-9]+)\.html$” => “$1/forumdisplay.php?fid=$2&page=$3”,
“^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$” => “$1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3”,
“^(.*)/space-(username|uid)-(.+)\.html$” => “$1/space.php?$2=$3”,
“^(.*)/tag-(.+)\.html$” => “$1/tag.php?name=$2”
)

好了,至于最新的Discuz X3的伪静态规则嘛,大家自己测试一下,貌似有网友说可以和DX2.5的通用,我以为数据库的问题没有测试过,如果有哪位大神研究出来了,一定要分享一下哦。