How to append query string & value via IIS rewrite rule?

前端 未结 1 1277
陌清茗
陌清茗 2020-12-19 01:54

I\'m running IIS 7 with the offical rewrite rule module installed. I\'d like to create a rewrite rule to match this URL:

         


        
相关标签:
1条回答
  • 2020-12-19 02:30

    Found the solution by myself, just share it.

    <rewrite>
        <rules>
            <rule name="Redirect for download result page" stopProcessing="true">
                <match url="(.*)/test.aspx(.*)" />
                <action type="Redirect" url="{R:1}/test.aspx?rf=sp" appendQueryString="true" redirectType="Found" />
                <conditions>
                    <add input="{QUERY_STRING}" pattern="flag=value" negate="true" />
                </conditions>
            </rule>
        </rules>
    </rewrite>
    
    0 讨论(0)
提交回复
热议问题