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

查看:22
本文介绍了设置 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?

推荐答案

[Updated 31.10.2014] 好的!有用!这是我从头开始的方法,所以其他有同样问题的人也可以解决它.首先我将解释如何设置 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 domain:add 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 -> 域 -> 选择您的域 ->启动(这将带您进入域详细信息)

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(Alias) -> 'Host' 应该是 www 和'Points to' 应该是你的 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 :)

有用的链接:

感谢 Ryan Kazinec 的帮助 :)

Thanks to Ryan Kazinec for help :)

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

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