Why does a domain does not display its full path?

208 views Asked by At

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

There are 3 answers

0
bobbyong On BEST ANSWER

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!

1
Steve Wilhelm On

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.

2
Wil Tan On

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.