1. Modify C:\inetpub\custerr\zh-CN\403.htm file, add in
<script type= "Text/javascript" >
var url=window.location.href;
Url=url.replace ("http:", "https:")
window.location.replace (URL);
</script>
The SSL-required SSL settings in IIS management need to be checked so that when you visit a page that is not HTTP, you jump to the 403 error page before you jump to the HTTPS page.
2. For the ASP.net site, you can modify the Web.config configuration file directly:
<?xml version= "1.0" encoding= "Utf-8"?> <configuration> <system.webserver
> <rewrite> <rules> <rule name= "HTTP to HTTPS redirect" stopprocessing= "true" > <match url= "(. *)"/> <conditions> <add input= "{HTTPS}" pattern= "Off" ignoreCase = "true"/> </conditions> <action type= "Redirect" redirecttype= "Found" url= "Https://{http_h" Ost}/{r:1} "/> </rule> </rules> </rewrite> </system.webServer> </configu Ration>