URLRewrite 在 iis6+iis7中的配置

简介:

之前使用URLRewrite在IIS6中一切正常,但是在IIS7却不能正常使用,提示“无法找到资源”,这时需要在web.config中system.webServer节点中的handlers节点进行配置,如下:

IIS6中的配置:

复制代码

 1   <configuration>
 2 
 3       <configSections>
 4           <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
 5       </configSections>
 6       <RewriterConfig>
 7           <Rules>
 8               <RewriterRule>
 9                   <LookFor>~/Index\.aspx</LookFor>
10                  <SendTo>~/Content/Index.aspx</SendTo>
11              </RewriterRule>
12          </Rules>
13      </RewriterConfig>
14  
15      <system.web>
16          <httpHandlers>
17              <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
18          </httpHandlers>
19      </system.web>
20 
21   </configuration>
复制代码

  如果在IIS7中使用,需在web.config中加入:

复制代码

 1 <configuration>
 2 
 3          <system.webServer>
 4          <validation validateIntegratedModeConfiguration="false"/>
 5          <modules>
 6              <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
 7          </modules>
 8          <system.webServer>
 9 
10 </configuration>
复制代码

加入以上代码后,URLRewrite就可以同时在IIS6和IIS7中正常使用了。

--EricZhang
本文转自today4king博客园博客,原文链接:http://www.cnblogs.com/jinzhao/archive/2009/09/16/1567893.html,如需转载请自行联系原作者
相关文章
|
网络安全 Windows
Windows IIS 10如何配置自签名SSL并实现自动跳转
本文记录了IIS配置自签名证书及HTTPS跳转的注意事项。包括解决443端口占用问题、URL Rewrite插件安装与配置、web.config修改方法,以及避免因旧教程导致的配置错误。
Windows IIS 10如何配置自签名SSL并实现自动跳转
|
网络协议
windows_server2012搭建iis并配置http重定向 iis转发
windows_server2012搭建iis并配置http重定向 iis转发
1045 1
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
487 2
|
开发框架 .NET 中间件
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
437 0
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
|
Windows
iis配置http重定向302转发get请求并去掉最后的斜杠/ iis重定向 iis去除url最后的斜杠 iis重定向链接斜杠(已解决)
iis配置http重定向302转发get请求并去掉最后的斜杠/ iis重定向 iis去除url最后的斜杠 iis重定向链接斜杠(已解决)
1336 0
|
JavaScript Windows
VUE部署到IIS中报404错误解决方案-配置URL重写
VUE部署到IIS中报404错误解决方案-配置URL重写
1430 0
|
开发框架 .NET Shell
安装与配置IIS
安装与配置IIS
591 0
安装与配置IIS
|
Windows
IIS配置MIME类型
IIS配置MIME类型
|
网络安全
IIS配置FTP
IIS配置FTP过程
676 0
IIS配置FTP
|
Windows
Win10的IIS服务器详细安装与配置
Win10的IIS服务器详细安装与配置
2286 0
Win10的IIS服务器详细安装与配置