简体   繁体   English

Heroku应用程序不适用于自定义域

[英]Heroku app not working with custom domain

I deployed a node app on heroku and pointed a custom domain to it from namecheap. 我在heroku上部署了一个节点应用程序,并从namecheap指向了一个自定义域。 When I type my domain in it will load a page that says "Theres nothing there, yet" and changes the url to domain.com.herokudns.com 当我输入域名时,它将加载一个页面,上面写着“那里什么都没有”,并将网址更改为domain.com.herokudns.com

After looking around for 2 days I came back to the same solution, I created two cname records on namecheap that pointed to the "domain.com.herokudns.com". 环顾了两天后,我又回到了相同的解决方案,我在namecheap上创建了两个指向“ domain.com.herokudns.com”的cname记录。 The cname records automatically place a period after this target, when I place a period after my domain when searching, my website loads. cname记录会自动在该目标之后放置一个句点,当我在搜索时在域名之后放置一个句点时,我的网站就会加载。

Is there a way to fix this? 有没有办法解决这个问题? I've seen people with similar problems but I find it weird that my site will load both with www and without if I have a period at the end. 我曾见过遇到类似问题的人,但我发现我的网站同时加载www和不加结束符都很奇怪。

I had to change the cname record to a www name with the target of [herokuappname].herokuapp.com and add a url redirect @ to http://[www.yourdomain.tld] . 我必须将cname记录更改为以[herokuappname] .herokuapp.com为目标的www名称,并将URL重定向@添加到http:// [www.yourdomain.tld] After clearing my cache this worked. 清除我的缓存后,此方法有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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