The routes package also allows for sub-domain based dispatch, which you can
use with multiple ObjectDispatchControllers so you have a separate
controller tree for cars.application.com than you do for
trucks.application.com

This use case has not been fully explored, and I think we should create a
simple recipie or two for this, so let us know if there's anything else we
can do to help.

A bit of detail can be found here:

http://pylonsbook.com/alpha1/urls_routing_and_dispatch

(search for sub-domain)


On Sun, Dec 28, 2008 at 9:55 AM, Diez B. Roggisch <[email protected]> wrote:

>
> Aigarius schrieb:
> > Hello all,
> >
> > I am writing a complex web site in TG2 and am wondering about how to
> > best realise on of our design goals.
> >
> > Let's assume that we have the main site on http://www.example.com and
> > we want our users to be able to do actions on different types of
> > objects. While we could use URL such as
> http://www.example.com/cars/Toyota/diesel/2003/
> > and have the root controller contain a line such as:
> >
> > cars = CarController()
> >
> > We would like to be able to use URLs like
> http://cars.example.com/Toyota/diesel/2003/
> > and have that be handled by a separate controller within the same TG2
> > application. I could not find a reference to such way of doing things
> > in the documentation and got too lost in the source to figure it out
> > myself.
> >
> > Could someone please point me to a proper way of doing such a thing?
>
> I think you *should* be able to faciliate mod_rewrite/mod_proxy of the
> apache for this. Create a vhost for both domains, and let the latter use
> mod_rewrite and mod_proxy to internally rewrite the query in the way you
> described above.
>
> This would of course open up a cars-namespace unde www.example.com, but
> that shouldn't be to bad.
>
> Alternatively, you could create two applications that share their
> codebase, as Chris explained.
>
> Diez
>
> >
>


-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to