Board logo

标题: [Discuz!相关] DZ X伪静态规则 [打印本页]

作者: shillan    时间: 2010-10-3 11:58     标题: DZ X伪静态规则

apache web server(独立主机用户)

<ifmodule mod_rewrite.c>
         rewriteengine on
         rewriterule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&amp;topic=$2
         rewriterule ^(.*)/article-([0-9]+)\.html$ $1/portal.php?mod=article&amp;articleid=$2
         rewriterule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&amp;fid=$2&amp;page=$3
         rewriterule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&amp;tid=$2&amp;extra=page\%3d$4&amp;page=$3
         rewriterule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&amp;fid=$2&amp;page=$3
         rewriterule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&amp;$2=$3
         rewriterule ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3
</ifmodule>

apache web server(虚拟主机用户)

# 将 rewriteengine 模式打开
rewriteengine on

# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
rewritebase /discuz

# rewrite 系统规则请勿修改
rewriterule ^topic-(.+)\.html$ portal.php?mod=topic&amp;topic=$1
rewriterule ^article-([0-9]+)\.html$ portal.php?mod=article&amp;articleid=$1
rewriterule ^forum-([0-9]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&amp;fid=$1&amp;page=$2
rewriterule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&amp;tid=$1&amp;extra=page\%3d$3&amp;page=$2
rewriterule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&amp;fid=$1&amp;page=$2
rewriterule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&amp;$1=$2
rewriterule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2


iis web server(独立主机用户)

[isapi_rewrite]

# 3600 = 1 hour
cacheclockrate 3600

repeatlimit 32

# protect httpd.ini and httpd.parse.errors files
# from accessing through http
rewriterule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&amp;topic=$2&amp;$3
rewriterule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&amp;articleid=$2&amp;$3
rewriterule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&amp;fid=$2&amp;page=$3&amp;$4
rewriterule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&amp;tid=$2&amp;extra=page\%3d$4&amp;page=$3&amp;$5
rewriterule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&amp;fid=$2&amp;page=$3&amp;$4
rewriterule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&amp;$2=$3&amp;$4
rewriterule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&amp;$4


zeus web server

match url into $ with ^(.*)/topic-(.+)\.html\?*(.*)$
if matched then
         set url = $1/portal.php?mod=topic&amp;topic=$2&amp;$3
endif
match url into $ with ^(.*)/article-([0-9]+)\.html\?*(.*)$
if matched then
         set url = $1/portal.php?mod=article&amp;articleid=$2&amp;$3
endif
match url into $ with ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
         set url = $1/forum.php?mod=forumdisplay&amp;fid=$2&amp;page=$3&amp;$4
endif
match url into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
         set url = $1/forum.php?mod=viewthread&amp;tid=$2&amp;extra=page\%3d$4&amp;page=$3&amp;$5
endif
match url into $ with ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
         set url = $1/forum.php?mod=group&amp;fid=$2&amp;page=$3&amp;$4
endif
match url into $ with ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$
if matched then
         set url = $1/home.php?mod=space&amp;$2=$3&amp;$4
endif
match url into $ with ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$
if matched then
         set url = $1/$2.php?rewrite=$3&amp;$4
endif


nginx web server

rewrite ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&amp;topic=$2 last;
rewrite ^(.*)/article-([0-9]+)\.html$ $1/portal.php?mod=article&amp;articleid=$2 last;
rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&amp;fid=$2&amp;page=$3 last;
rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&amp;tid=$2&amp;extra=page%3d$4&amp;page=$3 last;
rewrite ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&amp;fid=$2&amp;page=$3 last;
rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&amp;$2=$3 last;
rewrite ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
作者: zdesmk75    时间: 2012-1-16 12:54

我轻轻的来又轻轻的走了
作者: www.xauke.com    时间: 2012-7-21 12:24

谢谢您的辛苦发帖
作者: www.356t.com    时间: 2012-8-29 20:40

祝楼主快乐,大家一齐讨论!
作者: 北纬40ave    时间: 2012-11-4 08:03

此帖必火!
作者: sirdxd    时间: 2012-11-5 15:03

我也想听大家的建议!谢




欢迎光临 逐梦论坛 (http://temp2023.zhumeng.org/) Powered by Discuz! 7.2