URLRewriter.dll asp.net伪静态

一、添加引用
   URLRewriter.dll 下载文件 点击下载此文件
二、<configuration>输入下插入以下代码

程序代码 程序代码
<configSections>
        <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
    </configSections>  
    <RewriterConfig>
        <Rules>
            <!-- Rules for Blog Content Displayer -->
            <RewriterRule>
                <LookFor>~/pro-(.[0-9]*)\.html</LookFor>
                <SendTo>~/pro.aspx?ID=$1</SendTo>
            </RewriterRule>
            <RewriterRule>
                <LookFor>~/index\.html</LookFor>
                <SendTo>~/default.aspx</SendTo>
            </RewriterRule>
        </Rules>
    </RewriterConfig>


三、<system.web>下插入以下代码

程序代码 程序代码
<httpHandlers>
  <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
  <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>


    
这是官方源文件.看Readme.txt 下载文件 点击下载此文件

原文地址:https://www.cnblogs.com/sontin/p/1929814.html