Owen Fraser-Green
2006-Jul-13 22:34 UTC
[Rails] Virtual hosting within one application (with lighttpd)
Hi, I''ve found plenty of descriptions of hosting multiple applications on different virtual hosts using lighttpd and apache however, I''d like to have a single Rails application but route different controllers to the document root depending upon the requested hostname. (And in case you''re wondering why anyone would want to do such a thing, it''s because I would like web site on www and a WAP site on wap which use different controllers but share the same model and a lot of other code). I''ve tried lighttpd''s mod_rewrite but, while it rewrites the URL internally, when it gets passed to Rails, the requested URI isn''t rewritten so Rails always sees '''' when requesting the root document. I''ve tried looking at routes.rb but as far as I can tell, there''s no way to create a route based on server name. Cheers, Owen