Discuz!的IIS Rewrite设置
http://tech.ddvip.com 2008年09月08日 社区交流 收藏本文
内容摘要:本文告诉你如何为Discuz!设置IIS Rewrite,包括IIS安装Rewrite和http.ini两个部分。
安装Rewrite
1.下载ISAPI_Rewrite.ISAPI_Rewrite 附件下载
2.对筛选对应规则进行编写,即httpd.ini 文件(在此,编写规则不做讨论,已经在附件中附带)
3.打开Internet 信息服务,右键,web站点属性,点击ISAPI筛选器选项卡.添加筛选器,名称自己填,路径自己指定ISAPI_Rewrite.dll,然后确定.
4.重启iis服务器,重启IIS的iisreset命令
httpd.ini的内容
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/((fid|tid)-[w-]+.html)?*(.*)$ $1/archiver/index.php?$2&$4
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html?*(.*)$ $1/forumdisplay.php?fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html?*(.*)$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+).html?*(.*)$ $1/space.php?$2=$3&$4
RewriteRule ^(.*)/tag-(.+).html?*(.*)$ $1/tag.php?name=$2&$3
然后进入论坛系统设置的搜索引擎优化,根据需要开启 URL 静态化功能。
来源:PHP资讯 责编:豆豆技术应用