• UrlReWriter 在web.config中简单的配置


    1.配置的第一个节点

    <configSections>
        <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,Intelligencia.UrlRewriter"/>
    </configSections>

    2.配置的第二个节点

    <httpModules>    
          <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" />
    </httpModules>

    3.配置的第三个节点(ASP.NET4.0才需要)

    <system.webServer>
            <validation validateIntegratedModeConfiguration="false"/>
            <modules>
              <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule"/>
        </modules>
    </system.webServer>    

    4.编写规则

      <rewriter>
        <rewrite url="~/about.html" to="~/Default.aspx" processing="stop" />
        <rewrite url="^.*-d([0-9]+)/?$" to="~/Default.aspx?ID=$1" processing="stop" />
      </rewriter>

    这规则主在<configSections>后面

    5.设置IIS

    网站——属性——主目录——配置——在通配符应用程序映射中点插入——在可执行文件中,浏览(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll)当你的网站是.Net2.0的,

  • 相关阅读:
    Nokia N78拍照最佳设置!
    摩托Milestone购机鉴别篇
    sdf
    js随笔
    jssip无法识别以数字开始的域
    ASP.NET页面生命周期与优化
    在SQLServer2005中使用全文搜索
    简析正则表达式
    《WCF编程》之错误
    《WCF编程》之实例管理
  • 原文地址:https://www.cnblogs.com/ljx2012/p/2754869.html
Copyright © 2020-2023  润新知