欢迎来到资源库(www.zyku.net)

ASP.NET

当前位置:首页 > 网络编程 > ASP.NET > IIS8

IIS8 通过web.config 实现http跳转到https

时间:2020-05-09|栏目:ASP.NET|点击:|我要投稿

安装url重写2.0之后,编辑web.config

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="http 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}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

原文链接:https://blog.csdn.net/gdali/java/article/details/83014230

(资源库 www.zyku.net)

关于我们 | 版权申明 | 寻求合作 |

重要申明:本站所有的文章、图片、评论等内容,均由网友发表或上传并维护或收集自网络,仅供个人学习交流使用,版权归原作者所有。

如有侵犯您的版权,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:95148658 | 邮箱:mb8#qq.com(#换成@)

苏ICP备2020066115号-1

本网站由提供CDN加速/云存储服务