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

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

  • 相关阅读:
    IIS7配置URL Rewrite链接重写
    wordpress导航菜单的链接支持弹出新页面
    c++绝对是拯救了世界,特别是程序员
    Linux 磁盘坏道检测和修复
    centos里mysql无法用localhost连接的解决方法
    php扩展开发
    IP多播
    因特网的路由选择协议
    ICMP协议
    ARP协议
  • 原文地址:https://www.cnblogs.com/voidxy/p/1436219.html
Copyright © 2011-2022 走看看