I have an app hosted on Heroku and I got a freelance client to point her domain to my Heroku app (Cedar stack). The domain is now pointing correctly to my app but it does not display the full path. Meaning it stays at mydomain.com whether it is at / or at /contact (instead of mydomain.com/contact) or at /accounts/profile (instead of mydomain.com/accounts/profile). Clicking the refresh button will thus result in the / page being loaded.

What could possibly be the reason for such an occurrence? Thank you very much.

有帮助吗?

解决方案 3

My client gave me access to her domain registrar and I found the problem. Turned out she made a 302 redirect. So here's my complete solution on how I solved my problem:

  1. Add domain on shell "heroku domains:add www.example.com" - Heroku article: https://devcenter.heroku.com/articles/custom-domains
  2. Configure CNAME record for www type to point to myapp.herokuapp.com
  3. To ensure that example.com gets routed correctly too, make a 301 permanent redirection from your domain manager to http://www.example.com

That's it really. Thanks to all for your help!

其他提示

It's likely that she's using some sort of frame-based web forwarding feature provided by her domain registrar, which means that http://mydomain.com/ returns a HTML page with frame that targets your heroku app.

What you want is to ask her to create A records for "domain.com" pointing to the Heroku IPs, and CNAME records for "www.domain.com" pointing to myapp.herokuapp.com.

Did you configure your Heroku application with a custom domain?

With Heroku toolbelt, run heroku domains:add mydomain.com

See https://devcenter.heroku.com/articles/custom-domains for details.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top