I saw on the bottom of the following page that you can route requests to
different controllers based upon which subdomain is being requested.
http://wiki.rubyonrails.com/rails/pages/Routes
with_options :requirements=>{:subdomain=>‘first.com’} do
map.connect ‘’, :controller => “first/catalog”
map.connect ‘featured’, :controller => “first/catalog”,
:action=>‘featured’
map.connect ‘catalog/:action/:id’, :controller => “first/catalog”
end
So you could have one home page setup for one subdomain and another home
page for another subdomain. I’ve tried implementing this with Edge
Rails, but haven’t had any luck. The :subdomain requirement doesn’t seem
to have any affect. I must be missing something. I’ve looked through the
Edge Rails documentation and haven’t seen anything that talks about
using :subdomain. Does the domain or subdomain need to be passed into
the routes somehow? Any help would be appreciated.