▶▶▶Discuz! X3.1 VPS主机、IIS、Linux伪静态规则设置
Discuz! X3.1 VPS主机的伪静态httpd.conf规则设置:(1)服务器系统及 PHP:WINNT / PHP v5.X.X服务器软件:Microsoft-IIS/6.0
httpd.conf规则设置:RegistrationName= wlqcwin
RegistrationCode= 2EAD-35GH-66NN-ZYBA
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# 自定义错误页面
ErrorDocument 404 /404/index.html
# 默认包含了301设置,此设置情况下sxbbs.cn/aa.htm 会301跳至www.sxbbs.cn/aa.htm,将sxbbs.cn替换为您自己的域名就能实现自己的域名的301
# 第一条表示要做跳转的域名,第二条表示要跳转到的域名
RewriteCond %{HTTP:Host} ^sxbbs.cn$
RewriteRule (.*) https://www.sxbbs.cn$1
# 多个域名做跳转的方法:
# 首先复制多个 RewriteCond 项,将域名改好 除了最后一项,其余的 RewriteCond 项最后都要加个参数 即可。
RewriteCond %{HTTP:Host} ^0722pp.com$
RewriteCond %{HTTP:Host} ^www.0722pp.com$
RewriteCond %{HTTP:Host} ^suiw.net$
RewriteCond %{HTTP:Host} ^www.suiw.net$
RewriteCond %{HTTP:Host} ^szggmm.com$
RewriteCond %{HTTP:Host} ^www.szggmm.com$
RewriteCond %{HTTP:Host} ^shuizhidu.cn$
RewriteCond %{HTTP:Host} ^www.shuizhidu.cn$
RewriteCond %{HTTP:Host} ^hao0722.cn$
RewriteCond %{HTTP:Host} ^www.hao0722.cn$
RewriteCond %{HTTP:Host} ^hbsztv.cn$
RewriteCond %{HTTP:Host} ^www.hbsztv.cn$
RewriteRule (.*) https://www.sxbbs.cn$1
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Discuzx3.1
# 主题分类与分类信息伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/type-(\w+)-(+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&typeid=$3&typeid=$3&filter=typeid&page=$4
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/sort-(\w+)-(+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&sortid=$3&sortid=$3&filter=sortid&page=$4
#门户专题页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
#门户文章页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/article-(+)-(+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
#论坛主题列表页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/forum-(\w+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
#论坛主题内容页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/thread-(+)-(+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
#群组主题列表页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/group-(+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
#用户个人主页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
#用户日志内容页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/blog-(+)-(+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
#论坛 Archiver 页伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/(fid|tid)-(+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
#插件伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/(+*)-(+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
static/image/hrline/1.gif
httpd.ini:
# 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-(+)-(+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
RewriteRule ^(.*)/forum-(\w+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
RewriteRule ^(.*)/thread-(+)-(+)-(+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/group-(+)-(+)\.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-(+)-(+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
RewriteRule ^(.*)/(fid|tid)-(+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
RewriteRule ^(.*)/(+*)-(+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
static/image/hrline/1.gif
(2)服务器系统及 PHP : Linux / PHP v5.X.X服务器软件:Apache
.htaccess的规则配置:
<IfModule mod_rewrite.c>
# 将 RewriteEngine 模式打开
RewriteEngine On
ErrorDocument 404 /404/index.html
RewriteCond %{HTTP_HOST} ^sxbbs.cn$
RewriteRule ^(.*)$ https://www.sxbbs.cn/$1
# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /
# Rewrite 系统规则请勿修改
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
#Discuz!门户专题伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topicid=$2&%1
#论坛其他伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-(+)-(+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-(+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-(+)-(+)-(+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-(+)-(+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog-(+)-(+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^archiver/(fid|tid)-(+)\.html$ archiver/index.php?action=$1&value=$2&%1
#主题分类与分类信息伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^type-(\w+)-(+)-(+)\.html$ forum.php?mod=forumdisplay&fid=$1&typeid=$2&typeid=$2&filter=typeid&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^sort-(\w+)-(+)-(+)\.html$ forum.php?mod=forumdisplay&fid=$1&sortid=$2&sortid=$2&filter=sortid&page=$3&%1
#插件伪静态
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(+*)-(+)\.html$ plugin.php?id=$1:$2&%1
</IfModule>
以上由随县论坛(Www.sxbbs.cn)提供!(转帖请注明出处!)
我是个凑数的。。。
页:
[1]