| 输入 | 类型 | 模式 | 是否忽略大小写 | 备注 |
|---|---|---|---|---|
| {HTTPS} | 与模式匹配 | ^OFF$ | YES | 此项用来匹配你的请求是HTTPS还是HTTP |
| {HTTPS_HOST} | 与模式不匹配 | ^(localhost) | YES | 如果你是本地的localhost不会重定向到SSL |
高级版(直接把伪静态添加到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>
到此这篇关于IIS7 IIS8 http自动跳转到HTTPS(80端口跳转443端口)的文章就介绍到这了,更多相关http自动跳转到HTTPS内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!