I want to redirect my extranet site to https I have the following web.config rule:
<location path="." inheritInChildApplications="false">
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" `enter code here`ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}"
redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</location>
The problem comes because I have several services hosted on my server that are children, and I don't want them to redirect too, I just want to redirect the site not the services.
One way to do this is to by default redirect to HTTPS except for a specified list of folders. In the below example, folders
/service1/
and/service2/
are excluded from redirection. Everything else goes to HTTPS.