URLRewriter配置步骤

1.配置config文件

<configSections>
    <section name="RewriterConfig" requirePermission="false" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>

  </configSections>

  <system.web>

    <httpModules>
      <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>

    </httpModules>

  </system.web>

 

//正则 跳转规则
<RewriterConfig> <Rules> <RewriterRule> <LookFor>~/url/news(\d+)\.html?class=(\d+)</LookFor> <SendTo>~/Shownews.aspx?ShowID=$1;ampclass=$2</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/prt(\d+)\.html</LookFor> <SendTo>~/Show.aspx?ShowID=$1</SendTo> </RewriterRule> </Rules> </RewriterConfig>

 2.配置IIS

在iis-网站邮件属性里面-主目录-添加映射应用【aspnet_isapi.dll】按下图配置好确定

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

 

3.重启IIS就可以了

posted @ 2014-04-13 21:55  威尔逊  阅读(239)  评论(1)    收藏  举报