【问题标题】:IIS rewrite rules to modify the urlIIS重写规则修改url
【发布时间】:2015-10-08 08:51:48
【问题描述】:

以下是示例网址:

http://localhost/myapp/images/Loading/bandwidth_States.png

我想重写的:

http://localhost/myapp/images/Loading/bandwidth_States.png?ver=20131014

【问题讨论】:

    标签: asp.net iis url-rewriting


    【解决方案1】:

    我找到了答案:

    在 web.config 中:

    <system.webServer>
      <rewrite>
      <rules>
        <rule name="Image Versioning">
          <match url="(.*).png" />
            <action type="Rewrite" url="{R:0}" appendQueryString="true" />
            <conditions>
                <add input="{QUERY_STRING}" pattern="ver=20140320" negate="true" />
            </conditions>
        </rule>
      </rules>
    </rewrite>
    </system.webServer>
    

    【讨论】:

      猜你喜欢
      • 2014-10-27
      • 2014-05-01
      • 2011-04-21
      • 2014-01-05
      • 1970-01-01
      • 2019-03-15
      • 2012-06-19
      相关资源
      最近更新 更多