欢迎光临
我们一直在努力

iis如何默认访问https

在iis中设置默认访问https的方法

1.首先,在计算机香港vps中使用组合键“win+R”运行“Inetmgr”,打开iis管理器;

2.进入到iis管理器页面后,在页面中选择对应的站点;

3.在站点右侧菜单栏中,选择“URL重写”模块,并双击打开,添加规则;

4.最后,规则添加好后,在Web.config文件中添加以下配置即可;

<system.webServer>
<rewrite>
<rules>
<rule name="redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
</rules>
</rewrite>
</system.webServer>

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。