Forum: Ruby on Rails multiple virtual hosts within sigle rails installation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex Zhukov (Guest)
on 2006-03-22 06:43
(Received via mailing list)
Hello,

I'm proting an in-house application to ruby and RoR. The application
was in development & production
for over 3 years. It's about 50K LOC in php and python (using
twisted.python library). Porting from php to RoR is like a breath of
fresh air, and i have been able to 'fake' most of the twisted.python
features I use with ruby.

But I'm stuck with a stupid url mapping problem :(
I need severeal 3rd level domains to map to different controller
namespaces.
adminstuff.mydomain.com/controller has to map to
Adminstuff::Controller in app/adminstuff/controller
customer.mydomain.com/controller has to map to Customer::Controller
in app/cuscomer/controller etc.

It is a single application - it shares all config files, all models,
all libraries. Only the controllers and domain names are different.

The rails url map feature doesn't seem to support this kind of mapping.
I also tried to use url rewriting (with lighttpd) - looks like it
doesn't work for rails pages - dispatch.fcgi always gets the full url
without rewriting. Url rewriting works with static files though.

Any suggestions how I can accomplish this wihtout patching rails
dispatch methods?
--
best regards,
Alex Zhukov
removed_email_address@domain.invalid
This topic is locked and can not be replied to.