1

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.

bobbyong
  • 105
  • 6

3 Answers3

2

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.

Wil Tan
  • 701
  • 3
  • 4
  • 1
    Good idea re: the diagnoses. According to Heroku, A records are not recommended, JUST the CNAME -- the A records can point to the registrar who (usually) can do a 301 redirect from the naked domain to the www. – Andrew Gorcester Oct 15 '12 at 06:30
  • Agreed, it's not a good idea to use `A` records for production sites, or anything more serious than a hobby site that you don't care if the bare domain has performance or stability issues. – Wil Tan Oct 15 '12 at 06:37
0

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.

Steve Wilhelm
  • 6,200
  • 2
  • 32
  • 36
  • yea i've done that. the site is loading on mydomain.com but the rest of the path is not displaying. – bobbyong Oct 14 '12 at 15:33
0

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!

bobbyong
  • 105
  • 6