IIS使用伪静态从http跳转到https
IIS的伪静态是通过web.config实现,将web.config文件ftp传到网站根目录下:
如果您之前已经有做过web.config伪静态,则将下面web.config文件配置rewrite部分代码贴入您web.config文件内相应位置:
<?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_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>