积极答复者
iis 8.5下URLREWRITER模块不起作用

问题
-
OS:windows 2012 64位 数据中心版本
IIS:8.5
安装 iisrewriter(下载地址:http://download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi)
配置URL 重写信息(IIS自动生成的WEB.CONFIG文件内容):
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTPS}" matchType="Pattern" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Found" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
设置SSL为启用、忽略(参考网络的各种方法)
https方式访问 OK,但http访问就一直403错误,不能跳转到https。
- 已编辑 王当文 2016年5月4日 10:35
答案
-
你好,
如果你勾选了(Require SSL/要求 SSL)选项,那么你的网站将禁止除了https:// 以外的访问方式, 所以HTTP访问会返回403错误。
在勾选(Require SSL)的同时是不能够接收HTTP请求的。如果你需要同时接收HTTP和HTTPS请求, 你需要确保 Require SSL选项是没有被勾选的。
- 已建议为答案 Herro wongMicrosoft contingent staff 2016年5月14日 1:33
- 已标记为答案 Zhanglong WuMicrosoft contingent staff, Moderator 2016年5月19日 6:54
全部回复
-
你好,
如果你勾选了(Require SSL/要求 SSL)选项,那么你的网站将禁止除了https:// 以外的访问方式, 所以HTTP访问会返回403错误。
在勾选(Require SSL)的同时是不能够接收HTTP请求的。如果你需要同时接收HTTP和HTTPS请求, 你需要确保 Require SSL选项是没有被勾选的。
- 已建议为答案 Herro wongMicrosoft contingent staff 2016年5月14日 1:33
- 已标记为答案 Zhanglong WuMicrosoft contingent staff, Moderator 2016年5月19日 6:54