设为首页收藏本站邮箱

美妙人生

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
返回列表
查看: 4550|回复: 0

Discuz帖子别名Rewrite

[复制链接]
发表于 2012-11-6 12:58:48 | 显示全部楼层 |阅读模式
Discuz帖子别名 查看Rewrite 规则讨论
Rewrite上有任何问题的可以在这里提出
以下是默认的伪静态规则

Nginx Web Server
rewrite ^([^\.]*)/!(.+)-([0-9]+)-([0-9]+)$ $1/forum.php?mod=viewthread&alias=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/!(.+)$ $1/forum.php?mod=viewthread&alias=$2 last;

Apache Web Server(独立主机用户)
RewriteCond %QUERY_STRING ^(.*)$
RewriteRule ^(.*)/!(.+)-([0-9]+)-([0-9]+)$ $1/forum.php?mod=viewthread&alias=$2&extra=page\%3D$4&page=$3&%1
RewriteCond %QUERY_STRING ^(.*)$
RewriteRule ^(.*)/!(.+)$ $1/forum.php?mod=viewthread&alias=$2

Apache Web Server(虚拟主机用户)
RewriteCond %QUERY_STRING ^(.*)$
RewriteRule ^!(.+)-([0-9]+)-([0-9]+)$ forum.php?mod=viewthread&alias=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %QUERY_STRING ^(.*)$
RewriteRule ^!(.+)$ forum.php?mod=viewthread&alias=$1

IIS Web Server(独立主机用户)
RewriteRule ^(.*)/!(.+)-([0-9]+)-([0-9]+)(\?(.*))*$ $1/forum\.php\?mod=viewthread&alias=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/!(.+)$ $1/forum\.php\?mod=viewthread&alias=$2

IIS7 Web Server(独立主机用户)
<rule name="forum_viewthread">
        <match url="^(.*/)*!(.+)-([0-9]+)-([0-9]+)\?*(.*)$" />
        <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&alias={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
</rule>
<rule name="forum_viewthread">
        <match url="^(.*/)*!(.+)\?*(.*)$" />
        <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&alias={R:2}" />
</rule>

Zeus Web Server
match URL into $ with ^(.*)/!(.+)-([0-9]+)-([0-9]+)\?*(.*)$
if matched then
        set URL = $1/forum.php?mod=viewthread&alias=$2&extra=page\%3D$4&page=$3&$5
endif
match URL into $ with ^(.*)/!(.+)\?*(.*)$
if matched then
        set URL = $1/forum.php?mod=viewthread&alias=$2
endif

回复

使用道具 举报

小黑屋|手机版|美妙人生 ( 浙ICP备08108558号|人工智能  

GMT+8, 2018-9-22 19:27 , Processed in 0.007827 second(s), 6 queries , Redis On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表