3
votes

I've deployed a Rails 3.2 app to Heroku. I would like the app to be accessible from http://myapp.mydomain.com and for routes to be accessible from this url, e.g. http://myapp.mydomain.com/ModelA/1

I've followed the instructions at https://devcenter.heroku.com/articles/custom-domains

When I enter http://myapp.mydomain.com in the bowser addressbar it successfully takes me to the app.

BUT the url is rewritten as myapp.herokuapp.com

I've already added the domain to Heroku heroku domains:add myapp.mydomain.com.

How do I maintain the custom domain throughout my app?

1
I dont think you could do that.(not sure if you have paid service in heroku). The procedure you are doing above just creates a redirection from your domain to heroku and there after operation is done in heroku. - uday
It sounds like you've set up a redirect with your DNS host instead of setting up a CNAME. Can you post your DNS configuration? - drewinglis
@drewinglis I think you may be right about the DNS config. I've made some changes, and now the app is displaying the correct domain http://myapp.mydomain.com, but is not displaying the rest of the route. No matter which page I'm on, the URL remains the same. Strange! Any idea why this might be? - Andy Harvey
ok, this was a DNS issue, and either due to misleading layout on the providers admin panel, or my inability to read things properly. Either way, it is now fixed! @drewinglis your comment was spot on. Do you want to submit it as the answer? - Andy Harvey

1 Answers

2
votes

This looks like a DNS config issue. You should check your hosting provider to make sure you have your site set up as a CNAME to proxy.heroku.com, not a redirect or anything else.

(Glad you were able to solve it!)