<p>The IIS URL Rewrite Module 2.1 for IIS7+ may be your friend. The module can be downloaded from <a href="https://www.iis.net/downloads/microsoft/url-rewrite">IIS URL Rewrite</a>. <a href="https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module">Using the URL Rewrite Module</a> and <a href="https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-20-configuration-reference">URL Rewrite Module 2.0 Configuration Reference</a> explain how to use the module.</p>
<p>Once the module is installed, you can create a host wide redirect using IIS Manager. Select <em>URL Rewrite</em>, <em>Add Rule(s)…</em>, and <em>Blank rule</em>.</p>
<p><strong>Name:</strong></p>
<p>Redirect to HTTPS</p>
<p><strong>Match URL</strong></p>
<p><em>Requested URL:</em> <code>Matches the Pattern</code></p>
<p><em>Using:</em> <code>Wildcards</code></p>
<p><em>Pattern:</em> <code>*</code></p>
<p><em>Ignore case:</em> Checked</p>
<p><strong>Conditions</strong></p>
<p><em>Logical grouping:</em> <code>Match Any</code></p>
<p><em>Condition input</em>: <code>{HTTPS}</code></p>
<p><em>Check if input string:</em> <code>Matches the Pattern</code></p>
<p><em>Pattern:</em> <code>OFF</code></p>
<p><em>Ignore case:</em> Checked</p>
<p><em>Track capture groups across conditions:</em> Not checked</p>
<p><strong>Server Variables</strong></p>
<p>Leave blank.</p>
<p><strong>Action</strong></p>
<p><em>Action type:</em> <code>Redirect</code></p>
<p><em>Redirect URL:</em> <code>https://{HTTP_HOST}{REQUEST_URI}</code></p>
<p><em>Append query string:</em> Not checked</p>
<p><em>Redirect type:</em> <code>Permanent (301)</code></p>
<p>Apply the rule and run IISReset (or click Restart in the IIS Manager)</p>
<p>Alternatively, after installing the module you could modify the applicationHost.config file as follows:</p>
<p>`<system.webServer><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</system.webServer></p>
<pre><code class="lang-auto"></code></pre>