1

Possible Duplicate:
How to configure heroku application DNS to Godaddy Domain?

I purchased a domain from GoDaddy, say it's www.mysite.com, and I am hosting my app on Heroku mysite.herokuapp.com. When I click on mysite.herokuapp.com it should redirect-to www.mysite.com, my site to various pages (e.g. myapp.herokuapp.com/users)from code or similar but (mysite.herokuapp.com shuld not be accessible)

Community
  • 1
  • 1
Icicle
  • 1,174
  • 9
  • 13
  • check out http://stackoverflow.com/questions/7170664/how-to-configure-heroku-application-dns-to-godaddy-domain – jstim Oct 18 '12 at 07:05

1 Answers1

2

You should do it inside your Rails application.

Create a Rack middleware that inspects the HTTP_HOST variable. If the value doesn't match www.mysite.com, then send a redirect status code and redirect the user to the right path.

Here's a few examples you can start from to get an idea

Community
  • 1
  • 1
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364