httpiisurl-rewritingrequest.querystring

IIS rule "http rewrite" causes querystring duplicate


I set an IIS rule to redirect http traffic to https traffic, so I used the http rewrite rule. My original url contains 1 querystring param. When the rewrite is applied my new https url contains a duplicated querystring (2 equal params).

I tried modifying the rule by setting the appendQueryString param to false but it didn't worked.

Here's my rule:

<rewrite>
            <rules>
                <rule name="HTTP To HTTPS" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{HTTP_URL}" appendQueryString="false" redirectType="SeeOther" />
                </rule>
            </rules>
</rewrite>

Solution

  • try to clear browser cache and try again. as you explain I tested your rule it's working well with a query string and not repeating that. you can see the image.

    enter image description here