discuzX3.0 伪静态Apache和IIS环境下的文件配置

来源:互联网 发布:js indexof 第一个 编辑:程序博客网 时间:2024/06/05 23:07

Apache下,代码如下

# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 /discuz 为您的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /RewriteBase /# Rewrite 系统规则请勿修改RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1

复制保存为.htaccess在win下新建的话,挺麻烦的。贴上百度网盘链接:http://pan.baidu.com/share/link?shareid=2306693052&uk=2130749356,里面包含的httpd.ini是IIS环境下需要用到的。

[ISAPI_Rewrite]# 3600 = 1 hourCacheClockRate 3600RepeatLimit 32# Protect httpd.ini and httpd.parse.errors files# from accessing through HTTPRewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5

顺手贴一下



原创粉丝点击