asp.net - IIS Rewrite Rule Redirect HTTP to HTTPS causes multiple RedirectURL querystring -
we're using rule redirect http https:
<rewrite> <rules> <rule name="redirect http https" enabled="true" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{https}" pattern="^off$" /> </conditions> <action type="redirect" url="https://{http_host}{http_url}" redirecttype="seeother" /> </rule> </rules> </rewrite>
this works fine when user has bookmarked url this:
h t t p://www.mysite.com/myapp/login.aspx?returlurl=/someurl
it redirect them https expected 2 returnurl querystring causes 404 error when login:
h t t p s://www.mysite.com/myapp/login.aspx?returnurl=/someurl&returnurl=/someurl
how handle case? in advance!
change action to:
<action type="redirect" url="https://{http_host}{http_url}" appendquerystring="false" redirecttype="seeother" />
note appendquerystring="false"
attribute :)
Comments
Post a Comment