i have setup website in iis , website has 2 applications (as shown in snapshot below).
i have enable https on applications. have installed ssl certificate , setup applications use https instead of http. want implement autoredirect http https, test application (personalcornertest). using urlrewrite using below links reference,
https://www.sslshopper.com/iis7-redirect-http-to-https.html (method 1) , https://blogs.msdn.microsoft.com/kaushal/2013/05/22/http-to-https-redirects-on-iis-7-x-and-higher/ (method 1)
i used below setting in configuration file of test application,
<rule name="http https redirect" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{https}" pattern="off" ignorecase="true" /> </conditions> <action type="redirect" redirecttype="found" url="https://{http_host}/{r:1}" />
however, issue is, after adding below code, when user tries access test site using http in url, automatically redirects https, non-test site (i.e. personalcorner) , not test application, confusing.
can let me know mistake doing in above setting? want implement autoredirect test application.
answering query myself!
the below configuration fixed issue,
<rewrite> <rules> <rule name="redirect https" stopprocessing="true"> <match url=".*" /> <conditions> <add input="{https}" pattern="off" ignorecase="true" /> </conditions> <action type="redirect" url="https://{http_host}{request_uri}" redirecttype="permanent" appendquerystring="false" /> </rule> </rules> </rewrite>
reference: how force https using web.config file
Comments
Post a Comment