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>

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

     

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

  • 相关阅读:
    「SELECT~FOR UPDATE NOWAIT」
    IT精英完美的七种生活方式
    ASP.NET下载CSV文件
    对一个Frame内控件的遍历
    .Net日期与时间的取得方法
    表的字段修改(SQL语句)
    谁能给我一些软件开发相关的名言警句
    LeetCode: Add two numbers
    LeetCode: 3Sum
    LeetCode: 4Sum
  • 原文地址:https://www.cnblogs.com/LouisZJ/p/8580023.html
Copyright © 2011-2022 走看看