0

I have a rails app running on Heroku and I want to rename it. This seems easy enough, but I also have users whom I want to redirect to the new URL if the visit the old one.

I suppose one way to do this would be to create a whole new Rails app with the old name who's sole purpose is to redirect traffic to the new address, but I'm wondering if there's a better way to do this.

1
  • 1
    I think the second app approach is your only way. You should be pointing a domain at it anyways, though, for this sort of reason.
    – ceejayoz
    Jul 14 '16 at 2:51
0

You don't need to create a new app. You can simply associate both domains to the same app, and handle the redirect internally in the app.

Intercept the request and check the domain the request is for. If the domain is the old one, redirect to the new one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.