Install the "URL REWRITE2" pseudo static module IIS7 needs to confirm whether to install the "URL REWRITE2" pseudo static module. If you have already installed it, you can skip Download address: Select Site URL rewriting. If the English version is installed, it should be [Url rewrite] Add Blank Rule Add Rule Name: HTTPS Match URL pattern: (. *) Add condition: Condition: {HTTPS} Mode: off Operation type selection: Redirect Redirect URL: //{HTTP_HOST}/{R:1} Then save it Advanced Edition Add pseudo static to web.config 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="//{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |