简体   繁体   中英

Heroku Custom Domain Issues

I couldn't access my heroku app with a www prepended to the domain name.

I had to change it from a root custom domain to a custom subdomain on Heroku.

After deleting the old domain settings and reinstalling, I keep getting this when I run

host www.darader.com

www.darader.com is an alias for darader.herokuapp.com.
darader.herokuapp.com has address 18.235.131.220
darader.herokuapp.com has address 3.208.142.122
darader.herokuapp.com has address 52.0.3.28
darader.herokuapp.com has address 54.164.210.125
darader.herokuapp.com has address 34.226.45.27
darader.herokuapp.com has address 34.232.191.21
darader.herokuapp.com has address 52.21.209.224
darader.herokuapp.com has address 52.203.224.128

Thanks in advance.

To choose a custom domain name, you should have have the nameserver set to the Namecheap BasicDNS dropdown option.

I bought a domain name eg "examplewebsite.com" and had issues with getting the heroku app on there. So to add a domain name you type:

heroku domain:add www.examplewebsite.com

in command line.

My issue was not having the "www" in the domain name.

After you type the command, it will give you a DNS target in the form of <RandomWordsLettersAndNumbers>.<herokudns.com> , which is the value you put in the "Advanced DNS" tab of the namecheap dashboard. You must also make sure to put the type as CNAME in the namecheap type.

You can check your domain with:

heroku domains

In heroku CLI, after typing this command, it will give you information on your domains. It will give you "DNS Record Type" which should come up as " CNAME ". If it says " ALIAS or ANAME ", it means you need to put "www" before the domain name on your source URL in the redirect domain section of namecheap.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM