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.

Toby 1 Kenobi
  • 247
  • 2
  • 12
  • 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 02:51

1 Answers1

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.

Simone Carletti
  • 1,494
  • 3
  • 15
  • 30