zoukankan      html  css  js  c++  java
  • 使用URLRewriter

    URLRewriter  ,伪静态

    发布可能遇到问题,需要如下配置 iis

    、在Web.Config的<system.web>和</system.web>添加以下节点:

    <httpHandlers>
    <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    </httpHandlers>
    2、在Web.Config的<configuration>和</configuration>添加以下节点:

    <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
    </configSections><RewriterConfig>
    <Rules>
    <RewriterRule>
    <LookFor>~/d(\d+)\.html</LookFor>
    <SendTo>~/Default.aspx?MyID=$1</SendTo>
    </RewriterRule>
    </Rules>
    </RewriterConfig>
    设置完以上两个步骤,就基本可以运行了,其中<RewriterRule/>标签里面就是重写的一个模块,<LookFor/>里面的是重写后的地址,而<SendTo/>则是原地址。


    3、配置IIS解析.html文件
    IIS配置:网站->属性->虚拟目录->配置(G)...->映射->通配符应用程序映射->添加
    可执行文件:c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
    扩展名为:.html

    确认文件是否存在:不选.

  • 相关阅读:
    Navicat for SQLite之外键(05)
    UIButton
    多线程中的API
    UIImageView
    IOS中实现单例
    IOS中的多线程【二】— NSOperation和NSOperationQueue
    IOS中的多线程
    OC中新增的数据类型
    【转】c# DBF数据库导入导出实例
    【经验】学习新知识的经验
  • 原文地址:https://www.cnblogs.com/voidxy/p/1436219.html
Copyright © 2011-2022 走看看