如果没有"www",Namecheap域将不会重定向. [英] Namecheap domain won't redirect without "www"
问题描述
我希望将我的域连接到heroku应用.到目前为止,我已经阅读的教程说我们希望Namecheap拥有域example.com
的以下记录:
I'm looking to connect my domain to a heroku app. So far, the tutorials I've read say we want Namecheap to have the following records for domain example.com
:
CNAME Record www www.example.com.herokudns.com
URL Redirect @ https://www.example.com
通过此配置,我可以使用以下方法成功访问我的主页
With this config, I can successfully get to my homepage using:
- http://example.com/
- http://www.example.com/
- https://www.example.com/
但是由于某些原因, http://example.com/无法连接并超时.有谁知道是否有办法同时获得 https://example.com/和
But for some reason http://example.com/ won't connect and times out. Does anyone know if there's a way to get both https://example.com/ and https://www.example.com/ to redirect successfully?
推荐答案
您将无法使用DNS提供的重定向来做到这一点.
You won't be able to do this with DNS provided redirects.
原因是在重定向时,即您的DNS提供商,他们需要:
The reason is that at the point of redirect, ie your DNS provider they would need to:
- 接受对重定向器的https/443请求
- 具有hacksofcharity.com的有效证书
如果没有,则您将收到超时或浏览器中的证书不匹配.如果https涉及到顶点域,则您唯一的选择是使用支持CNAME的DNS提供程序-请参见
if they don't you'll either receive a timeout, or a certificate mismatch in your browser. When apex domains are involved with https then your only option is to be using a DNS provider that supports using CNAME - see https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain and perform any redirects within your application code base.
这篇关于如果没有"www",Namecheap域将不会重定向.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!