Several different domains names point to my app on heroku, for example foo.com and bar.com both point to the app. (We host specialized blog pages, and foo.com is the domain used
I usually proceed as follows:
constraints(Subdomain) do
match "/" => "home#admin"
end
match "/" => "home#standard"
Or:
match "/" => "home#admin", :constraints => {:subdomain => "admin"}
match "/" => "home#standard"
Which creates:
/(.:format) {:action=>"admin", :subdomain=>"admin", :controller=>"home"}
root /(.:format) {:action=>"standard", :controller=>"home"}
The same logic lets you create routes only available to desired subdomains.