您好,欢迎来到中国名创! [请登录] [免费注册] [忘记密码]

discuz论坛系统伪静态规则列表(rewrite)

时间:2015-04-10 15:51来源:中国名创

Discuz! 论坛(BBS),是一个采用 PHP 和 MySQL开放的开源论坛系统,完全免费,目前国内使用最多的一种论坛。可以安装在windows平台,linux平台上,也可以使用专门的discuz空间云主机VPS主机上,下面就列出各种版本的伪静态规则。


1.discuz 老版本规则


#discuz 老版本规则
RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4
RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3


2.Discuz!x和discuz x1.5伪静态规则

#Discuz!x和discuz x1.5伪静态规则
RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4

3.discuz-------supsite/x-space规则


#discuz-------supsite/x-space
RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2


4.discuz NT规则
#Start dznt URL Rewrite (discuz NT)

    RewriteRule ^(.*)/userinfo-([0-9]+)\.html$  $1/userinfo.aspx?userid=$2
    RewriteRule ^(.*)/showforum-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2
    RewriteRule ^(.*)/showtopic-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2
    RewriteRule ^(.*)/showforum-([0-9]+)-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2&page=$3
    RewriteRule ^(.*)/showtopic-([0-9]+)-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2&page=$3
    RewriteRule ^(.*)/archiver/showforum-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2
    RewriteRule ^(.*)/archiver/showtopic-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2
    RewriteRule ^(.*)/archiver/showtopic-([0-9]+)-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2&page=$3
    RewriteRule ^(.*)/archiver/showforum-([0-9]+)-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2&page=$3
    RewriteRule ^(.*)/tools/rss-([0-9]+)\.html$  $1/tools/rss.aspx?forumid=$2
    RewriteRule ^(.*)/tools/spacerss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=space
    RewriteRule ^(.*)/tools/photorss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=photo
    RewriteRule ^(.*)/space\/((\w|\s)+)((\/?))?$  $1/space/index.aspx?user=$2
    RewriteRule ^(.*)/space\/((\w|\s|-)+)((\/?))?\?((.*)+)$  $1/space/index.aspx?user=$2&$6

    RewriteRule ^(.*)/showdebate-([0-9]+)\.html$  $1/showdebate.aspx?topicid=$2
    RewriteRule ^(.*)/showbonus-([0-9]+)\.html$  $1/showbonus.aspx?topicid=$2

    RewriteRule ^(.*)/postgoods-(\d+)*.html$  $1/postgoods.aspx?categoryid=$2
    RewriteRule ^(.*)/showgoodslist-(\d+)(-(\d+))?.html$  $1/showgoodslist.aspx?categoryid=$2&page=$4
    RewriteRule ^(.*)/showgoods-(\d+)*.html$  $1/showgoods.aspx?goodsid=$2

#End dznt URL Rewrite settings


#uchome
RewriteRule ^(.*)/(space|network)-(.+)\.html$ $1/$2\.php\?rewrite=$3 [L]
RewriteRule ^(.*)/(space|network)\.html$ $1/$2\.php [L]
RewriteRule ^(.*)/([0-9]+)$ $1/space\.php\?uid=$2 [L]
RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4
#end uchome


5.dzx2.0  apache和iis通用

#dzx2.0  apache和iis通用(apache需去除[NU]参数)
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1 [NU]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1


6.dzx2.5 apache和iis通用
#dzx2.5 apache和iis通用(apache需去除[NU]参数)
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1


7.dzx3.0 apache和iis通用
#dzx3.0 apache和iis通用(apache需去除[NU]参数)
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1

中国名创www.chuang.top 整理发布。
------分隔线----------------------------
相关文章:
Linux虚拟主机PHP程序返回Fatal erro
虚拟主机php程序返回Fatal error: Un
虚拟主机HTTP 错误 403.14 - Forbidd