Rails route path to specific root domain when applications has two domains

Viewed 11

I have a rails application and was wondering how I can route or reroute a specific path to one specific root domain when there are two.

My application has two domains for example: www.example.com and www.sample.com

I have a path called '/submissions' the path can be accessed from both domains because the application works on both domains. So if user goes to www.example.com/submissions and www.sample.com/submissions then they access the same form.

My problem is that I want a user to always access it through www.sample.com/submissions . So if they go www.example.com/submissions I need to re-route it to www.sample.com/submissions

I am not sure if I should use some sort of constrain on my route in the route.rb file.

Any help would be great!

0 Answers
Related