【网管知识】IIS服务器设置伪静态重写

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

1. 安装重写插件Rewrite.dll 

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

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

加载 Rewrite.dll 

在 IIS 的 Isapi 上添加筛选器  ,将压缩包解压到任意目录,(如:C:/Rewrite)。然后打开“控制面板”-“管理工具”-“IIS信息服务管理器”-“网站”-“您的站点”-“属性”。在“ISAPI筛选器”项点击 “添加”,筛选器名称填入Rewrite,可执行文件为C:/Rewrite/Rewrite.dll ;

筛选器名称为: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 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值