zoukankan      html  css  js  c++  java
  • IIS 7 站点设置支持url_rewrite

    站点从2003 的IIS6 迁移到 2008的IIS7发现web.config里面配置的URL_Rewrite不生效,也查了好久,先贴下配置文件

    <configSections>
            <!-- 地址重写配置 -->
            <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
            <!--日志记录-->
            <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
        </configSections>
        <RewriterConfig>
            <Rules>
                <!--重写规则 -->
                <!--<RewriterRule>
                    <LookFor>~/(.[0-9]*)</LookFor>
                    <SendTo>~/v2/play.html?roomid=$1</SendTo>
                </RewriterRule>-->      
                <RewriterRule>
            <LookFor>~/(d+)</LookFor>
            <SendTo>~/v5/player.aspx?roomid=$1</SendTo>
          </RewriterRule>
                <RewriterRule>
                    <LookFor>~/jy/(w+)</LookFor>
                    <SendTo>~/jy/play.aspx?roomid=$1</SendTo>
                </RewriterRule>
          <RewriterRule>
            <LookFor>~/user/(.[0-9]*)</LookFor>
            <SendTo>~/v4/userspace.aspx?uidx=$1</SendTo>
          </RewriterRule>
          <!--<RewriterRule>
            <LookFor>~/room/(.[0-9]*)-(.[0-9]*).html</LookFor>
            <SendTo>~/v2/roomlist_v.aspx?sid=$1&amp;serverid=$2</SendTo>
          </RewriterRule>-->
          <!--<RewriterRule>
            <LookFor>~/room/(.[0-9]*)-(.[0-9]*).html</LookFor>
            <SendTo>~/v2/roomlist_v.aspx?sid=$1&amp;serverid=$2</SendTo>
          </RewriterRule>-->
          <RewriterRule>
            <LookFor>~/room/list-(.[0-9]*)-(.[0-9]*).html</LookFor>
            <SendTo>~/v5/roomList.aspx?dq_id=$1&amp;id=$2</SendTo>
           </RewriterRule>
          <RewriterRule>
            <LookFor>~/m(d+)</LookFor>
            <SendTo>~/v6/player.aspx?useridx=$1</SendTo>
          </RewriterRule>
           </Rules>
        </RewriterConfig>

    只需要进行简单的配置就可以生效

     

    记录一下,以防下次再忘记了

  • 相关阅读:
    IssueQuery failed in redmine rake tasks
    rubymine 调试 redmine
    redmine rake tasks
    rails tutorial sample app
    win7 chm 打开失败记录
    rails再体验(第一个程序)
    Bitnami Redmine插件开发记录
    redmine export long csv file failed: 502 proxy error
    Java时区切换时的需要注意
    Android No static field XXX of type I in class Lcom/XXX/R$id错
  • 原文地址:https://www.cnblogs.com/LouisZJ/p/8580023.html
Copyright © 2011-2022 走看看