windows服务器IIS强制http跳转https

在根目录找到web.config之后直接复制下面的重定向代码进去即可

windows服务器IIS强制http跳转https

在根目录找到web.config之后直接复制下面的重定向代码进去即可

<?xml version="1.0" encoding="UTF-8"?>
 
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="http redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF[        DISCUZ_CODE_0        ]quot; />
                        <add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

如果您的服务器配置了web.config没有生效
请查看您是否有安装URL重定向工具
如果还没有安装
请传送到微软官网下载安装
https://www.microsoft.com/zh-cn/ … mation.aspx?id=7435

编辑:娜娜,如若转载,请注明出处:https://www.yimenapp.com/kb-yimen/5065/

部分内容来自网络投稿,如有侵权联系立删

(0)
上一篇 2022年6月1日 上午11:12
下一篇 2022年6月1日 上午11:24

相关推荐