如何配置Google域名+ Heroku的裸体域名 [英] How to configure Google Domains + Heroku w a Naked Domain
问题描述
我使用Heroku和Google Domains在网络浏览器中加载域名。现在,域名加载了一个www: http:// www 。 XXX .com。
如果我输入的WWW URL如http:// XXX .com,我在Chrome中收到以下错误:XXX.com的服务器无法找到DNS地址
我需要做些什么,以便发生以下情况:
- 加载 - http:// mydomain.com
- http:// www 。 mydomain.com重定向到http:// mydomain.com
谢谢
IMHO,你应该:
1 /将你的英雄域设置为 http://example.com 。所有信息都在 Heroku文档。
Heroku应该使用 http://example.com 。
2 /您需要在Google域中重定向您的 http://www.example.com http://example.com 。为此,您需要在Google域控制台的网站标签下设置网络转发。 文档很简单。
任何 http://www.example.com 请求应转发到 http://example.com 。
更新 / p>
由于您的需要,我想知道如果最好不要禁用裸机到www重定向,同时将这两个域指向您的英雄实例并获得SSL证书(使用let的加密使事情变得容易)。
这是一个教程。
希望这有帮助! / p>
I have a domain loading in a web browser using Heroku and Google Domains. Right now the domain loads with a www: http://www. XXX .com.
If I enter the URL w/o the WWW like http:// XXX .com I get the following error in Chrome: "XXX.com’s server DNS address could not be found"
What do I need to do so that the following happens:
- This loads - http:// mydomain.com
- http://www. mydomain.com redirects to http:// mydomain.com
Thank you
IMHO, you should:
1/ Set your heroku domain to be http://example.com. All the info are in the Heroku documentation.
Heroku should serve your site using http://example.com.
2/ You need to redirect in Google Domains your http://www.example.com to http://example.com. To do this, you need to set web forwarding in the Google Domain console under the website tab. The documentation is straight forward.
Any http://www.example.com request should be forwarded to http://example.com.
UPDATE
Due to your needs, I am wondering if the best is not to disable the naked to www redirection, have both domain points to your heroku instance and get a SSL certificate for them (using let's encrypt makes things easy).
Here is a tutorial.
I hope this helps!
这篇关于如何配置Google域名+ Heroku的裸体域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!