【发布时间】:2016-09-03 02:35:44
【问题描述】:
我已经在我的 IIS 服务器上安装了 WordPress,并且还安装了 SSL 证书。
我已经研究了我能找到的每一个线程,但仍然无法让它工作。我从 Apache 上遇到同样问题的一个人那里找到了this thread,但我在 IIS 上,不知道如何让它与 IIS 一起工作。
与该线程类似,这是正在发生的事情:
https://www.example.com 运行良好
https://example.com 正在重定向到上面,也很棒!
问题来了:
http://www.example.com 仍然可以访问,不好,因为这应该重定向到 https://www.example.com
还有:
http://example.com 重定向到http://www.example.com。
我该如何解决这个问题,以便它全部重定向到https://www.example.com?
我在 IIS 上,这是我的 web.config 的样子:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
【问题讨论】:
-
你试过this吗?
-
除了已经存在的规则之外,我还会添加该规则吗?如果是,新规则是在之前还是之后?
-
上次我尝试过,我网站上的所有图片都坏了,我还是继续了,它成功了。谢谢:)
标签: wordpress redirect ssl iis