Strict-Transport-Security
If you haven't implemented HTTPS on your website, you should. After doing so, you can prevent any communication happening over HTTP using the Strict-Transport-Security
header:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
</customHeaders>
</httpProtocol>
</system.webServer>
The max-age
value tells browsers to use this setting for the specified number of seconds. In this case a year. The includeSubDomains
part can be excluded, if you are hosting non-HTTPS websites on subdomains