大网数据广告活动
网站运营与故障问答

Domain configuration for website with and without www

· 52CE 我爱测

I have a heroku app with the following settings: Domain name: www.localhost.com DNS Target: safe-springs-1527.herokuapp.com The domain is on GoDaddy. The settings there are: A (Host) 0 Records (0 Selected) AAAA (IPv6 Host) 0 Reco…

问题原文

原帖链接 · Stefanos.Ioannou · CC BY-SA 3.0

I have a heroku app with the following settings:

Domain name: www.localhost.com
DNS Target: safe-springs-1527.herokuapp.com

The domain is on GoDaddy. The settings there are:

A (Host) 
0 Records (0 Selected)

AAAA (IPv6 Host) 
0 Records (0 Selected)

CName (Alias) 
Host Points To
email   email.secureserver.net
ftp safe-springs-1527.herokuapp.com
www safe-springs-1527.herokuapp.com

When I try to createa a CName record which will be with host "@" and to point to "safe-springs-1527.herokuapp.com" I get the error The specified record already exists. CNAME - @.

My website is accessible when I use www.localhost.com but not when I use localhost.com.

I also have in mind what is needed is an A record which points to an IP. Unfortunately heroku gives me a dynamic host which its IP changes.

I posted this issue on reddit and through the discussions I understood that what I am trying to do is not possible and the only solution would be to move to CloudFlare. I am not sure if I have to move my domain or app there but my concern is different. I just can't grasp that. I can't believe that all apps on heroku have this issue.

Is this the case or am I missing something (on heroku's or godaddy's end or...)?

已采纳解答

原帖链接 · Stefanos.Ioannou · CC BY-SA 3.0

I found this on Heroku and now my domain works fine without the www. I am not sure what it does.

In short:

Root domains must be added in addition to any subdomains. The process for adding root domains is the same in the Heroku CLI:
$ heroku domains:add example.com
Adding example.com to example... done
!    Configure your app's DNS provider to point to the DNS Target example.herokuapp.com
!    For help, see https://devcenter.heroku.com/articles/custom-domains

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。