Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9214880
  • 博文数量: 187
  • 博客积分: 7517
  • 博客等级: 少将
  • 技术积分: 1981
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-20 18:51
文章分类

全部博文(187)

文章存档

2015年(3)

2013年(4)

2012年(20)

2011年(2)

2010年(96)

2009年(14)

2008年(47)

2007年(1)

我的朋友

分类: 系统运维

2010-04-02 13:51:48

要使你的IIS服务器支持伪静态重写,按以下步骤来: 

1. 安装重写插件Rewrite.dll 

如果你的 IIS 服务器加载过 Rewrite.dll 则可以不用下载。 

Rewrite.dll文件:http://blog.hxxsh.com/UploadFiles/2006-10/1013525016.rar 

加载 Rewrite.dll 

在 IIS 的 Isapi 上添加筛选器 

筛选器名称为:re 

可执行文件选择 Rewrite.dll 就可以了! 

2. 配置 httpd.ini 
打开你的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/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2 
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3 
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3 
RewriteRule ^(.*)/profile-(username|uid)-(.+?)\.html$ $1/viewpro\.php\?$2=$3 

  

以上是 Discuz!官方提供的配置代码,注意正则格式。 

3. 应用 
比如,将read.php?bl_id=123&bu_id=456 伪静态成 /html/123/456.html 

可以这样写: 

RewriteRule ^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/read\.php\?bl_id=$2&bu_id=$3 点击收藏:“IIS下下伪静态html(URL Rewrite)设置方法”

阅读(656) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~