Search code examples
herokudnsregistrar

Why does a domain does not display its full path?


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.


Solution

  • 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!