设置Heroku和GoDaddy? [英] Set up Heroku and GoDaddy?

查看:83
本文介绍了设置Heroku和GoDaddy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取通过GoDaddy购买的域名,以便与我的Heroku托管站点一起使用。

I am trying to get a domain name I bought through GoDaddy to work with my Heroku hosted site.

如何配置我的域名以与Heroku一起使用?

How do I configure my domain name to work with Heroku?

推荐答案

[2014年10月31日更新] !有用!这是我从头开始做的,因此其他有相同问题的人也可以修复它。首先,我将说明如何设置Heroku和GoDaddy,然后将说明如何创建裸域(www.example.com-> example.com)。

[Updated 31.10.2014] Allright! It works! Here is how I did it from scratch, so others with the same problem can fix it too. First I will explain how to setup Heroku and GoDaddy, then I will explain how to create a naked domain (www.example.com -> example.com).

设置Heroku和GoDaddy:


  1. 在终端中的项目文件夹中(在计算机上)写 heroku域名:添加www.example.com (其中 www.example.com 是您在GoDaddy购买的域名)

  1. In your project folder in terminal (on your computer) write heroku domains:add www.example.com (where www.example.com is the domain you have bought at GoDaddy)

登录GoDaddy-> DOMAINS->选择您的域->
启动(这将带您进入域详细信息)

Sign in to GoDaddy -> DOMAINS -> choose your domain -> Launch (this will take you to the Domain Details)

单击 DNS区域文件选项卡

Click 'DNS Zone File' tab

删除名为 www的CNAME记录(到@)

Remove the CNAME record named 'www' (which points to @)

单击'添加记录'-> CNAME(别名)->'主机'应为 www
指向应该是您的Heroku地址(例如
supermoo-bil-3411.herokuapp.com )。 TTL可以是1个小时。

Click 'Add record' -> CNAME(Alias) -> 'Host' should be www and 'Points to' should be your Heroku address (example supermoo-bil-3411.herokuapp.com). TTL can be 1 hour.

DNS可能需要花费一些时间来进行传播。对我来说大约花了10分钟。

It can take some time for the DNS to propogate. For me it took about 10 minutes.

就是这样! supermoo-bil-3411.herokuapp.com www.example.com :)

That's it! supermoo-bil-3411.herokuapp.com will now be under www.example.com :)

创建一个裸域:

裸域消除了在前写www的需要您的域名。这可以通过将 example.com 转发到 www.example.com 来完成。在GoDaddy上,这非常简单:

A naked domain removes the need to write www in front of your domain name. This can be done by forwarding example.com to www.example.com. This is super easy on GoDaddy:


  1. 在与上述相同的窗口中,单击设置标签

  1. In the same window as above, click on the 'Settings' tab

正在转发->域->单击管理->然后单击添加转发

Under Forwarding -> Domain -> Click 'Manage' -> then click 'Add Forwarding'

转发到应为 www.example.com (您的域),重定向类型应为 301
(永久),转发设置 '应该为'仅转发'

'Forward to' should be www.example.com (your domain), 'Redirect type' should be '301 (Permanent)', 'Forward settings' should be 'Forward only'

确保选中更新我的名称服务器和DNS设置以支持此更改。(推荐)

Make sure "Update my nameservers and DNS settings to support this change. (Recommended)" is checked

就是这样!您已完成:)

That's it! You are done :)

有用的链接:

  • https://devcenter.heroku.com/articles/custom-domains

感谢Ryan Kazinec的帮助:)

Thanks to Ryan Kazinec for help :)

这篇关于设置Heroku和GoDaddy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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