iis6下配置URLRewriter

web.config下配置  <configuration> 节点下的<configSections>

<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
</configuration>
<configuration> 
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/123.aspx</LookFor>
<SendTo>~/store.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/123.html</LookFor>
<SendTo>~/store.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/123</LookFor>
<SendTo>~/store.aspx</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
</configuration>
 <system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
<add verb="*" path= "*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
</system.web>

接下就是映射ISAPI了

在你的网站--->属性--->虚拟目录--->配置---->映射--->添加   

.html  对应  aspnet_isapi.dll     注意去掉检查文件是否存在

iis 6.0 支持无后缀url

在你的网站--->属性--->虚拟目录--->配置---->映射--->添加   

.*  对应  aspnet_isapi.dll     注意去掉检查文件是否存在

iis 7.0 下支持 URLRewriter

  <system.webServer>
<modules>
<add name="ModuleRewriter" type="URLRewriter.ModuleRewriter, URLRewriter"/>
</modules>
</system.webServer>





原文地址:https://www.cnblogs.com/haomo/p/2417683.html