I want to serve 2 different domains on my rails application, let''s say http://A.com and http://B.com When you type http://A.com in a browser to get one set of routes inside the rails application (let''s say starting with index.html), when you type http://B.com to get another set (starting with default.html) A complet isolation would be great, like 2 different routes.rb. Is this possible? I use nginx and mongrel if is important. Thanks, AD --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thats funny, I just came here to find a solution for this. I want also to be able to run multi domains on one application. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I may found the answer here, take a look: http://agilewebdevelopment.com/plugins/request_routing Let me know if it''s working for you... --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AD wrote:> I want to serve 2 different domains on my rails application, let''s say > http://A.com and http://B.com...> > Is this possible? I use nginx and mongrel if is important.There''s a partial solution here: http://weblog.jamisbuck.org/2006/10/26/monkey-patching-rails-extending-routes-2 But be sure to read the following discussion. Jamis says: "You''ll notice, if you actually try to use it, that route generate is a little wonky now, unless you use named routes exclusively. Route generation is hard to make work with the host/domain/subdomain thing, because route generation has no access to the request. In fact, route generation does not generate the host portion of the URL; it generates only the path. It''s a hard problem." Having worked on this problem last week, I can attest that what he speaks the truth:-) Incoming requests work fine, but url_for (and anything that uses it) will be broken for any routes that share the same "signature", and you''ll have to hack in something to handle that problem. --Al Evans -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-02 21:48 UTC
Re: domain based routes?
Guys, the request routing plugin extends routing to support domains and subdomains (among other things) and I would definitely recommend it for this. The README and RDoc are quite sufficient. I have used it in the past to provide things like per-domain theme support. If you are using a named virtual host there may be some additional nginx configuration for you to do. Rein On Sep 2, 4:41 pm, AD <adin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I may found the answer here, take a look: > > http://agilewebdevelopment.com/plugins/request_routing > > Let me know if it''s working for you...--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
so why it''s not working? map.connect ''index.html'', :controller => ''items'', :action => ''list'' , :conditions => { :domain => ''second'' } I get: Valid criteria are strings, regular expressions, true, or nil On Sep 2, 5:48 pm, rein.henri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Guys, the request routing plugin extends routing to support domains > and subdomains (among other things) and I would definitely recommend > it for this. The README and RDoc are quite sufficient. I have used it > in the past to provide things like per-domain theme support. > > If you are using a named virtual host there may be some additional > nginx configuration for you to do. > > Rein > > On Sep 2, 4:41 pm, AD <adin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I may found the answer here, take a look: > > >http://agilewebdevelopment.com/plugins/request_routing > > > Let me know if it''s working for you...--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
my bad, it''s working on my local computer, I''ll try on the server also. Thanks! On Sep 2, 6:06 pm, AD <adin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> so why it''s not working? > > map.connect ''index.html'', :controller => ''items'', :action => > ''list'' , :conditions => { :domain => ''second'' } > > I get: > > Valid criteria are strings, regular expressions, true, or nil > > On Sep 2, 5:48 pm, rein.henri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > Guys, the request routing plugin extends routing to support domains > > and subdomains (among other things) and I would definitely recommend > > it for this. The README and RDoc are quite sufficient. I have used it > > in the past to provide things like per-domain theme support. > > > If you are using a named virtual host there may be some additional > > nginx configuration for you to do. > > > Rein > > > On Sep 2, 4:41 pm, AD <adin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I may found the answer here, take a look: > > > >http://agilewebdevelopment.com/plugins/request_routing > > > > Let me know if it''s working for you...--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---