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

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

  • 相关阅读:
    Python open 读和写
    Sublime Text的使用
    解决MySQL Workbench导出乱码问题
    统计学(一)
    pymysql使用(二)
    使用pymysql(使用一)
    2个Excel表格核对技巧
    用Python读写Excel文件的方式比较
    从零上手Python关键代码
    php面试
  • 原文地址:https://www.cnblogs.com/voidxy/p/1436219.html
Copyright © 2011-2022 走看看