小编Nic*_*gas的帖子

IIS上从http到https的URL重写不起作用,

我有个问题.在IIS我有一个网站有两个端口80443(https).我想将http用户的所有请求重定向到https.我还补充说Rewrite rule to https,但是当我进入浏览器时,http://localhost/site它给了我相同的页面.我需要将用户重定向到httpS://localhost/site.

也许这是因为我的本地配置?

我禁用Require SSLIIS.

The rule is:
<rewrite>
  <rules>
    <rule name="HTTPS Redirect">
      <match url="(.*)" ignoreCase="false" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="false" />
      </conditions>
      <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" />
    </rule>
  </rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)

谢谢.

asp.net-mvc https iis-7 http url-rewriting

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

asp.net-mvc ×1

http ×1

https ×1

iis-7 ×1

url-rewriting ×1