天空小小岛技术网站
标题:
升级到Discuz!X后,原来版块或帖子访问地址仍可正常访问的Rewrite规则
[打印本页]
作者:
云天一
时间:
2010-5-13 16:44
标题:
升级到Discuz!X后,原来版块或帖子访问地址仍可正常访问的Rewrite规则
升级到Discuz!X后,版块或帖子保持原来访问地址的Rewrite规则
iis6下规则
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^(.*)/(forumdisplay|viewthread|redirect|faq)\.php\?(.*) $1/forum\.php\?mod=$2&$3
RewriteRule ^(.*)/(space)\.php\?(.*) $1/home\.php\?mod=$2&$3
复制代码
iis7下规则加在web.config里面
<rule name="for_bbs">
<match url="^(.*)/(forumdisplay|viewthread|redirect|faq).php" />
<action type="Rewrite" url="{R:1}/forum.php?mod={R:2}&%{QUERY_STRING}" />
</rule>
<rule name="for_uchome">
<match url="^(.*)/(space).php" />
<action type="Rewrite" url="{R:1}/home.php?mod={R:2}&%{QUERY_STRING}" />
</rule>
复制代码
apache虚拟机用户在官方给出的规则后面加
RewriteEngine On
# 修改以下语句中的 /x 为你的论坛目录地址,如果程序放在根目录中,请将 /x 修改为 /
RewriteBase /x
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(forumdisplay|viewthread|redirect|faq)\.php forum.php?mod=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(space)\.php home.php?mod=$1&%1
复制代码
apache独立主机
<IfModule mod_rewrite.c>
RewriteRule ^(.*)/(forumdisplay|viewthread|redirect|faq)\.php $1/forum.php?mod=$2&%{QUERY_STRING}
RewriteRule ^(.*)/(space)\.php $1/home.php?mod=$2&%{QUERY_STRING}
</IfModule>
复制代码
作者:
八号
时间:
2010-6-13 09:47
保持UCHOME相关链接 方法:
http://www.tkxxd.net/thread-183-1-1.html
作者:
一粒米
时间:
2014-8-26 17:50
nginx 的怎么能没有呢?
rewrite ^(.*)/(forumdisplay|viewthread|redirect|faq)\.php $1/forum.php?mod=$2&$query_string last;
rewrite ^(.*)/(space)\.php $1/home.php?mod=$2&$query_string last;
复制代码
欢迎光临 天空小小岛技术网站 (http://tkxxd.net/)
Powered by Discuz! X3.1