Is domain name 1and1 redirecting HTTP or Frame with Heroku host?

So, I bought a domain from 1and1, say, www.mysite.com , and I host my app on Heroku myapp.herokuapp.com . I have two options for domain forwarding - HTTP and Frame. The HTTP forwarding seems to just redirect my url from www.mysite.com to myapp.herokuapp.com , which I don't want. But I have a problem with frame redirection - if I navigate my site to different pages (for example, myapp.herokuapp.com/users ), it will still say www.mysite.com from above, but not www.mysite.com/users . How can I display the url correctly?

+7
source share
1 answer

You do not want to use the (i) frame method - this is bad practice and you will get the problems that you have now.

What you probably want to do is:

  • Attach www.yourdomain.com to your Heroku application (via the web interface or CLI [1]).
  • Set up a CNAME record to specify www - yourapp.herokuapp.com with your DNS provider or use the Zerigo DNS add-on [2] if you don’t already have a DNS hosting (it sounds like)
  • (Optional) Set up a redirect for direct http://yourdomain.com to http://www.yourdomain.com , through your DNS provider / domain registrar - this is optional but useful, as Heroku does not recommend specifying your root domain (yourdomain .com) to their A records if changed.
  • (Optional) Redirecting http://myapp.herokuapp.com/ to http://www.yourdomain.com/ from your application code or (for example, config.ru if you use Rack to serve your content)

[1] https://devcenter.heroku.com/articles/custom-domains [2] https://addons.heroku.com/zerigo_dns

+10
source

All Articles