IIS URL将规则HTTP重写为HTTPS并添加WWW [英] IIS Url Rewrite rule HTTP to HTTPS AND add WWW

查看:250
本文介绍了IIS URL将规则HTTP重写为HTTPS并添加WWW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我希望只与WWW子域和HTTPS一起使用。
我有一个URL重写工作用于添加WWW。但现在我也想强制HTTP到HTTPS重定向。只是强制HTTPS工作,但当我无法弄清楚如何组合2。

I have a website that I want to be only used with the WWW sub-domain and via HTTPS. I had an URL rewrite working for adding WWW. But now I also want to force a HTTP to HTTPS redirect. Just forcing HTTPS works as well, but when I can't really figure out how to combine the 2.

有人可以为我提供重定向到 https://www.domain.com 。

Can someone provide me with a working rule that redirects to https://www.domain.com in case the request is without WWW and/or via HTTP.

推荐答案

问题在于我没有裸域证书,仅适用于www.mydomain.com。因此,当我将访问者从domain.com重定向到www.domain.com时,浏览器仍然会验证裸域的证书(缺失),并停止重定向以显示警告屏幕。

The problem was that I didn't have a certificate for the naked domain, only for www.mydomain.com. So when I was redirecting visitors from domain.com to www.domain.com the browser would still verify the certificate (missing) of the naked domain, and stop the redirect to show the warning screen.

通过简单地将裸域添加到我的证书中来解决问题。

Problem was fixed by simply adding the naked domain to my certificate.

这篇关于IIS URL将规则HTTP重写为HTTPS并添加WWW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆