On 26 Feb 2013, at 7:25 PM, greaneym <[email protected]> wrote: > I am confused by routes and I'm trying to learn how to use them. I see this > example, thinking it might apply to my situation, > "^[client]:[protocol]://[hostname]:[method] [url]$" > > and really I am just not sure how to do what I need because I don't know > enough, so I am just trying things until I get a result. So from what you > wrote, routes are only ever used on domains and their subdomains on the same > physical host. > > I have two apps on two different hosts with two different domains. I am > trying to set up a menu so that I can get from one to the other. I don't know > how to do the url redirect > sending the app to a different host, so I thought I needed to use routes. > There must be a way to do this, and if you'd kindly tell me what to read in > the manual that would be helpful.
Generally speaking, to redirect to another host you need to pass the host as an argument to URL(). The routes domain option won't help you here; it's for routing to different apps on the local host. > thanks > > > > On Tuesday, February 26, 2013 8:39:27 PM UTC-6, Jonathan Lundell wrote: > On 26 Feb 2013, at 6:32 PM, greaneym <[email protected]> wrote: >> If the parametric routes format is used to route domains, do the domains >> have to be on the same physical host? The cookbook refers to an example >> where the domains are on the same physical host on p. 273. >> >> >> Does an example like this work if the domains are on two physically separate >> hosts? >> >> routers = dict( >> BASE=dict( >> default_application='app1', >> domains={ >> 'domain1.com' : 'app1', >> 'domain2.com' : 'app2', >> } >> ), >> ) >> >> If this is not the right way to do it on two different hosts, may I see an >> example please? >> > > If a domain is not on a particular host, then on that host you'll never get a > request directed to that domain, right? Why would you bother to route it? > > -- > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

