I am trying to force HTTP-HTTPS on an Azure website to use the web.config URL rewrite rule. I need a rule that combines both of the following scenarios:
Http://site.domain.com/sitefolder for https://site.domain.com/sitefolder
HTTP://site.domain.com/sitefolder/default.aspx for https://site.domain.com/sitefolder/default.aspx
If I follow this guide , I can force HTTP-HTTPS, but the URL changes to https://site.domain.com without / sitefolder or / sitefolder / default.aspx.
This is what I have at the moment. HTTPS is forced, but the full URL is not included:
<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="Permanent" /> </rule>
source share