Heroku/GoDaddy:将裸域发送到 www [英] Heroku/GoDaddy: send naked domain to www
问题描述
我想弄清楚如何让我的网站的裸域重定向到 www 域.我正在使用 Heroku 并拥有来自 GoDaddy 的域.因为Heroku,我的A记录已经设置为:
@:75.101.145.87
@: 75.101.163.44
@:174.129.25.170
我的 www CNAME 指向 proxy.heroku.com.
我一直在寻找互联网,但找不到一个简单、免费的答案来说明如何进行此重定向.一些答案讨论使用付费服务,我不想这样做,而其他答案讨论进入和修改 Heroku 设置,但实际上并没有给出太多解释.现在,如果你去我的裸域,它只是 Heroku 说不存在这样的应用程序,而如果你去我的 www 域它是我的应用程序.
在 GoDaddy 上,使用转发"功能设置从 yourdomain.com
到 www.yourdomain.com 的转发代码>.可以在域信息"部分底部的域管理器中访问转发功能:
如果您这样做,那么所有到 yourdomain.com 的流量都将路由到 Heroku 应用程序 CNAME(即 更好的方法).
但是,请注意,如果您使用 Cedar 堆栈,请不要使用 proxy.heroku.com
用于 www
CNAME 的主机.而是使用 your-app-name.herokuapp.com
.这些详细信息在此处介绍.
GoDaddy 还指定,为了让您的域名转发,其 A 记录必须指向 64.202.189.170 或必须在以下范围内:50.63.202.1 - 50.63.202.31 或 184.168.221.1 - 184.168.221>
I am trying to figure out how to get the naked domain for my website to redirect to the www domain. I am using Heroku and have the domain from GoDaddy. Because of Heroku, my A records are already set up as:
@: 75.101.145.87
@: 75.101.163.44
@: 174.129.25.170
And my www CNAME points to proxy.heroku.com.
I've been looking all over the internet, but can't find a simple, free answer for how I can do this redirect. Some answers discuss using paid services, which I don't want to do, and others talk about going in and modifying Heroku settings, but then don't really give much explanation. Right now, if you go to my naked domain, it's just Heroku saying that no such app exists, while if you go to my www domain it's my app.
On GoDaddy, use the "Forwarding" feature to setup a forward from yourdomain.com
to www.yourdomain.com
. The forwarding feature can be accessed in the Domain Manager at the bottom of the "Domain Information" section:
If you do this then all traffic to yourdomain.com will be routed to the Heroku app CNAME (which is the better approach).
One note, however, if you are on the Cedar stack then don't use proxy.heroku.com
for the host of your www
CNAME. Instead use your-app-name.herokuapp.com
. These details are covered here.
GoDaddy also specifies that in order for your domain name to forward, its A record must be pointed to 64.202.189.170 or must fall between the following ranges: 50.63.202.1 - 50.63.202.31 or 184.168.221.1 - 184.168.221.31.
这篇关于Heroku/GoDaddy:将裸域发送到 www的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!