Problem Rewriting URL's from HTTPS to HTTP using IIS7 URL Rewriter, when using Webforms ReturnURL=

Posted by theminesgreg on Stack Overflow See other posts from Stack Overflow or by theminesgreg
Published on 2010-04-21T20:21:43Z Indexed on 2010/04/21 20:23 UTC
Read the original article Hit count: 276

Filed under:
|
|

I took Jeff's Re-write rules from this post and the HTTP to HTTPS conversion works great. However, going back to HTTP is giving me problems because of the ReturnUrl= in the URL (I'm using webforms).

Here's an example of the url: https://localhost/Login.aspx?ReturnUrl=%2f

Here's the rewrite rule I'm using:

<rule name="HTTPS to HTTP redirect for all other pages" stopProcessing="true">
                <match url="^login\.aspx$" ignoreCase="true" negate="true" />
                <conditions>
                    <add input="{SERVER_PORT}" pattern="^443$" />
                </conditions>
                <action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" />
            </rule>

Here's the resulting re-written URL: http://localhost/,/

Has anyone found a work around for this?

© Stack Overflow or respective owner

Related posts about url-rewriting

Related posts about iis7