ssl - URL 应该点击 https 而不是 http

标签 ssl redirect iis https windows-server-2012-r2

我正在运行一个 Windows Server,我在其中托管了一个站点。

现在我已经完成了网站 SSL 证书的绑定(bind)。但是每次我点击网站 URL 时,它都会转到 http 而不是 https。尽管我已将 http 和 https 与 SSL 证书绑定(bind)。

例子-

当我尝试访问 abc.com 时

it goes http://example.com

代替

https://example.com

我是否需要做更多的事情来帮助我解决这个问题。 所以每次我尝试访问

example.com

我会去的

https://example.com

有谁知道解决这个问题的方法吗!

最佳答案

您需要添加重定向以确保所有流量都被重定向,如下所示。确保您重写了 URL module安装。

<rule name="HTTPS force" enabled="true" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
     <add input="{HTTPS}" pattern="^OFF$" />
  </conditions>
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>

关于ssl - URL 应该点击 https 而不是 http,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52479709/

相关文章:

asp.net - 强制站点使用 SSL(通过 IIS)导致 WebResource.axd 加载问题

python - 重定向到引用页面的最佳方式

c# - 3rd party是302重定向到我的网站,如何停止?

iis - 我可以将单个 IP 与通配符 SSL 一起使用吗?

angular - 在 IIS 中部署 Angular 应用程序

关于反向代理到 TLS 微服务的 Spring Gateway 问题

css - 混合内容 - 不安全的样式表

apache - 如何检测我的服务是使用 SSL 还是 TLS 以及哪个版本

php - 如何在 .htaccess 文件中指定范围以重定向 url

jsf - 重定向时的 flash.keep 和 flash.setKeepMessages(true)