My app used to run on foo.tld but now it runs on bar.tld. Requests will still come in for foo.tld, I want to redirect them to bar.tld.
How can I do this in rails rou
similar to other answers, this one worked for me:
# config/routes.rb constraints(host: "foo.com", format: "html") do get ":any", to: redirect(host: "bar.com", path: "/%{any}"), any: /.*/ end