返回列表 发帖

[Discuz!相关] 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;
欢迎光临:逐梦论坛

我也想听大家的建议!谢

TOP

此帖必火!

TOP

祝楼主快乐,大家一齐讨论!

TOP

谢谢您的辛苦发帖

TOP

我轻轻的来又轻轻的走了

TOP

返回列表

Powered by Discuz! 7.2   论坛QQ群:逐梦论坛群

© 2001-2021 Comsenz Inc. 鲁公网安备 37120302000001号