windows2003 iis 伪静态设置

1、将下载的 IIS Rewrite 组件解压,放到适当的目录(如 C:Rewrite)下。

windows2003 iis 伪静态设置

 

2、在“IIS管理器”里选择网站,右键,属性。

windows2003 iis 伪静态设置

3、选择“ISAPI”,点击“添加”。

windows2003 iis 伪静态设置

4、填入筛选器名称,如“rewrite”。

windows2003 iis 伪静态设置

5、可执行文件下方点击“浏览”,选择刚才解压的Rewrite组件位置,Rewrite.dll。

windows2003 iis 伪静态设置

6、确认选择正确后,点击“确定”。

windows2003 iis 伪静态设置

7、点击“确定”,完成筛选器添加。

windows2003 iis 伪静态设置

8、重启IIS。

windows2003 iis 伪静态设置

windows2003 iis 伪静态设置

9、重启IIS后,再次选择站点,右键,属性,看到如下所示向上的绿箭头,说明 IIS Rewrite 成功添加并运行。

windows2003 iis 伪静态设置

IIS Rewrite 规则设置

解压后的 IIS Rewrite 组件目录(如 C:Rewrite)中,有一个 httpd.ini 文件,将相应规则写入到这个文件中即可。

 

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)设置方法”

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

1. 安装重写插件Rewrite.dll

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

加载 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

PW的规则:[ISAPI_Rewrite]
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有M币奖励和额外收入!

模板下载吧 主机教程 windows2003 iis 伪静态设置 https://www.mbxzb.com/blog/file/fuwuqi/4807.html

从明天起,做一个幸福的人,喂马、劈柴、周游世界…

常见问题
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用
查看详情

相关文章

评论
暂无评论
点击按钮快速添加回复内容: 支持 高兴 激动 给力 加油 苦寻 生气 回帖 路过 威武 友军 顶贴
官方客服团队

为您解决烦忧 - 24小时在线 专业服务