http带www的跳转https带www

lingang 2021-5-31 1321

你好, 有没有什么办法 http://www.abc.com/ 跳转到https://www.abc.com  现在网站都跳转https唯独 http带www 的不跳转https

最新回复 (3)
  • 6258 2021-5-31
    引用 2
    你好,建议使用IIS自带的URLrewrite功能,在需要设置强制跳转的网站根目录下,新建一个文件命名为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>
  • 6258 2021-5-31
    引用 3
    经检查您的服务器是2008系统,该系统只支持一张SSL证书,已经被另外个网站绑定。因此跳转会失败。
    建议更换为2012系统
  • lingang 2021-5-31
    引用 4
    好的,谢谢
返回
发新帖