Hubert Łępicki | 23 Jul 00:41

Routes dependent on subdomain


Hi,

I'm having little problem getting my idea to work, would be very
thankful if you could help me.

I have one Ruby on Rails application sitting on server, and multiple
subdomains, pointing to the same server/app. For example:

mainserver.com
user1.mainserver.com
user2.mainserver.com

I want to have exactly the same app and exactly the same routes on
all, except that I want to map root of mainserver.com to different
controller than other. For example:

mainserver.com => MainController
user1.mainserver.com => UserController
user2.mainserver.com => UserController

Any ideas how can I do it using Rails routes? Or possibly URL rewrite
in Apache proxy?

I am also considering different approach  - I will have 2 applications
running, and share part of code (models, some base controllers), and
map main web page to different instance than all other subdomains.

Thanks and best,
H.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane