逐梦论坛's Archiver

shillan 发表于 2010-10-3 11:58

DZ X伪静态规则

[b]apache web server(独立主机用户)[/b]

<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>

[b]apache web server(虚拟主机用户)[/b]

# 将 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


[b]iis web server(独立主机用户)
[/b]
[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


[b]zeus web server[/b]

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


[b]nginx web server
[/b]
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

我也想听大家的建议!谢

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.