我在Web.config文件中的条目<system.webServer>
下:重定向不是重定向
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.mydomain.com*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
我期望这http://www.mydomain.com
请求将被重定向到https://www.mydomain.com
。但是,这没有发生。
规则的格式有问题吗?还必须做其他事情以启用重定向吗?
这是在IIS 8下的Windows 2012计算机上运行.RewriteModule列在该网站的模块下。
更改后的行为相同。 –
@EricJ。试试这个。对不起,我以前的答案。 – rpax
这样做!任何想法,为什么?之前的模式也是匹配的。 –