当前位置:首页>>Discuz学习教程

discuzx2多服务器伪静态规则

点击数:1967 更新时间:2017-05-31 15:49:34 来源: 昕竹轩网站设计-返回

点评:其实就是从discuz后台拿下的,直接伪静态规则,大家可以根据自己服务器所用的版本选择,如果是虚拟主机客户需要咨询服务器提供商。 Apache Web Server(独立主机用户)

复制代码 代码如下:

RewriteEngine On
RewriteCond % ^(.*)$
RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.phpmod=topic&topic=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/article-(<0-9>+)-(<0-9>+)\.html$ $1/portal.phpmod=view&aid=$2&page=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/forum-(\w+)-(<0-9>+)\.html$ $1/forum.phpmod=forumdisplay&fid=$2&page=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/thread-(<0-9>+)-(<0-9>+)-(<0-9>+)\.html$ $1/forum.phpmod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/group-(<0-9>+)-(<0-9>+)\.html$ $1/forum.phpmod=group&fid=$2&page=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.phpmod=space&$2=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/blog-(<0-9>+)-(<0-9>+)\.html$ $1/home.phpmod=space&uid=$2&do=blog&id=$3&%1
RewriteCond % ^(.*)$
RewriteRule ^(.*)/(fid|tid)-(<0-9>+)\.html$ $1/index.phpaction=$2&value=$3&%1

Apache Web Server(虚拟主机用户)

复制代码 代码如下:
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /discuz
# Rewrite 系统规则请勿修改
RewriteCond % ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.phpmod=topic&topic=$1&%1
RewriteCond % ^(.*)$
RewriteRule ^article-(<0-9>+)-(<0-9>+)\.html$ portal.phpmod=view&aid=$1&page=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^forum-(\w+)-(<0-9>+)\.html$ forum.phpmod=forumdisplay&fid=$1&page=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^thread-(<0-9>+)-(<0-9>+)-(<0-9>+)\.html$ forum.phpmod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^group-(<0-9>+)-(<0-9>+)\.html$ forum.phpmod=group&fid=$1&page=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.phpmod=space&$1=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^blog-(<0-9>+)-(<0-9>+)\.html$ home.phpmod=space&uid=$1&do=blog&id=$2&%1
RewriteCond % ^(.*)$
RewriteRule ^archiver/(fid|tid)-(<0-9>+)\.html$ archiver/index.phpaction=$1&value=$2&%1
IIS Web Server(独立主机用户)

复制代码 代码如下:

# 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&topic=$2&$4
RewriteRule ^(.*)/article-(<0-9>+)-(<0-9>+)\.html(\(.*))*$ $1/portal\.php\mod=view&aid=$2&page=$3&$5
RewriteRule ^(.*)/forum-(\w+)-(<0-9>+)\.html(\(.*))*$ $1/forum\.php\mod=forumdisplay&fid=$2&page=$3&$5
RewriteRule ^(.*)/thread-(<0-9>+)-(<0-9>+)-(<0-9>+)\.html(\(.*))*$ $1/forum\.php\mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/group-(<0-9>+)-(<0-9>+)\.html(\(.*))*$ $1/forum\.php\mod=group&fid=$2&page=$3&$5
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\(.*))*$ $1/home\.php\mod=space&$2=$3&$5
RewriteRule ^(.*)/blog-(<0-9>+)-(<0-9>+)\.html(\(.*))*$ $1/home\.php\mod=space&uid=$2&do=blog&id=$3&$5
RewriteRule ^(.*)/(fid|tid)-(<0-9>+)\.html(\(.*))*$ $1/index\.php\action=$2&value=$3&$5
IIS7 Web Server(独立主机用户)

复制代码 代码如下:




































Zeus Web Server

复制代码 代码如下:
match URL into $ with ^(.*)/topic-(.+)\.html\*(.*)$
if matched then
set URL = $1/portal.phpmod=topic&topic=$2&$3
endif
match URL into $ with ^(.*)/article-(<0-9>+)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/portal.phpmod=view&aid=$2&page=$3&$4
endif
match URL into $ with ^(.*)/forum-(\w+)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/forum.phpmod=forumdisplay&fid=$2&page=$3&$4
endif
match URL into $ with ^(.*)/thread-(<0-9>+)-(<0-9>+)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/forum.phpmod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
endif
match URL into $ with ^(.*)/group-(<0-9>+)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/forum.phpmod=group&fid=$2&page=$3&$4
endif
match URL into $ with ^(.*)/space-(username|uid)-(.+)\.html\*(.*)$
if matched then
set URL = $1/home.phpmod=space&$2=$3&$4
endif
match URL into $ with ^(.*)/blog-(<0-9>+)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/home.phpmod=space&uid=$2&do=blog&id=$3&$4
endif
match URL into $ with ^(.*)/(fid|tid)-(<0-9>+)\.html\*(.*)$
if matched then
set URL = $1/index.phpaction=$2&value=$3&$4
endif
Nginx Web Server

复制代码 代码如下:
rewrite ^(<^\.>*)/topic-(.+)\.html$ $1/portal.phpmod=topic&topic=$2 last;
rewrite ^(<^\.>*)/article-(<0-9>+)-(<0-9>+)\.html$ $1/portal.phpmod=view&aid=$2&page=$3 last;
rewrite ^(<^\.>*)/forum-(\w+)-(<0-9>+)\.html$ $1/forum.phpmod=forumdisplay&fid=$2&page=$3 last;
rewrite ^(<^\.>*)/thread-(<0-9>+)-(<0-9>+)-(<0-9>+)\.html$ $1/forum.phpmod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^(<^\.>*)/group-(<0-9>+)-(<0-9>+)\.html$ $1/forum.phpmod=group&fid=$2&page=$3 last;
rewrite ^(<^\.>*)/space-(username|uid)-(.+)\.html$ $1/home.phpmod=space&$2=$3 last;
rewrite ^(<^\.>*)/blog-(<0-9>+)-(<0-9>+)\.html$ $1/home.phpmod=space&uid=$2&do=blog&id=$3 last;
rewrite ^(<^\.>*)/(fid|tid)-(<0-9>+)\.html$ $1/index.phpaction=$2&value=$3 last;
if (!-e $request_filename)
本资讯信息是来自 昕竹轩工作室 小编 通过网络收集而来的关于discuz网站开发,使用、安装、架设相关的学习资源。
您若也有需要分享的可以直接在我们网站上分享你的内容,让大家都知道。
版权声明,本活动信息隶属网络收集而来若有侵权请联系我们,我们将及时清除信息。

广告位
【责任编辑:CSW8923 (Top) 返回页面顶端
【必备推荐】(Top) 返回页面顶端
【精品案例】更多案例展示
【最新留言】 (Top) 返回页面顶端
共有0条评论
重要提示:
你设置的联系邮箱是*: (当有人给你留言回复之时,联系邮箱可以及时通知你)
我们建议你填写正确的邮箱地址,如果你之前填写邮箱地址是错误的可以通过 【修改资料】 来重新设置
登录 | 免费注册 | 忘记密码 | 邮箱:CSW8923@126.com     服务电话:17895923895   客服QQ:568441621 点击这里给我发消息
Copyright © 2014-2015 Htmcss.Com All Rights Reserved  版权所有昕竹轩网站设计 备案号:闽ICP备16024510号-4
关闭