The following is the exact rule that we use on the IIS 7 website to redirect the entire request from HTTP to HTTPS.
<configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
There are some slight differences between what you publish and what we use. In addition, since you are working on a local host, you would not use the integrated web server with visual studio, would you? I do not think that it will handle IIS rewrite rules.
Tommy source share