本帖最后由 神马 于 2012-1-12 21:45 编辑
如果你的空间使用的是Lighttpd系统,那么可以用下面这样的伪静态规则,该规则适用于Discuz! X2, Discuz! X2 RC等。
安装在根目录上用这个
- url.rewrite = (
- "^/topic-(.+)\.html\??(.*+)$" => "/portal.php?mod=topic&topic=$1&$2",
- "^/article-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/portal.php?mod=view&aid=$1&page=$2&$3",
- "^/forum-(\w+)-([0-9]+)\.html\??(.*+)$" => "/forum.php?mod=forumdisplay&fid=$1&page=$2&$3",
- "^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&$4",
- "^/group-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/forum.php?mod=group&fid=$1&page=$2&$3",
- "^/space-(username|uid)-(.+)\.html\??(.*+)$" => "/home.php?mod=space&$1=$2&$3",
- "^/([a-z]+)-(.+)\.html\??(.*+)$" => "/$1.php?rewrite=$2&$3")
复制代码 安装在子目录上用这样的(以子目录bbs为例)- url.rewrite-once = (
- "^/bbs/topic-(.+)\.html\??(.*+)$" => "/bbs/portal.php?mod=topic&topic=$1&$2",
- "^/bbs/article-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/bbs/portal.php?mod=view&aid=$1&page=$2&$3",
- "^/bbs/forum-(\w+)-([0-9]+)\.html\??(.*+)$" => "/bbs/forum.php?mod=forumdisplay&fid=$1&page=$2&$3",
- "^/bbs/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/bbs/forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&$4",
- "^/bbs/group-([0-9]+)-([0-9]+)\.html\??(.*+)$" => "/bbs/forum.php?mod=group&fid=$1&page=$2&$3",
- "^/bbs/space-(username|uid)-(.+)\.html\??(.*+)$" => "/bbs/home.php?mod=space&$1=$2&$3",
- "^/bbs/([a-z]+)-(.+)\.html\??(.*+)$" => "/bbs/$1.php?rewrite=$2&$3")
复制代码 |