Require HTTPS on Azure

To force HTTPS on an Azure site that is configured to run HTTPS and HTTP add the following to your web.config file:

<?xml version=”1.0″ encoding=”utf-8″?>
<rule name=”Redirect to HTTPS” stopProcessing=”true”>
<match url=”(.*)” />
<add input=”{HTTPS}” pattern=”^OFF$” />
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Permanent” />

Leave a Reply

Your email address will not be published. Required fields are marked *