On Jun 26, 2012, at 7:12 AM, villas wrote:
> I have spent a full day trying to make simple routing work.  Please,  I have 
> tried all the routers and read everything I can.  Could anyone please help?
> 
> Apache / wsgi  standard setup without any changes.  Single instance of web2py
> 
> Two domains and two apps:
> domain1.com  ->  app1
> domain2.com  ->  app2
> 
> One other URL renaming pattern:  
> plugin_wiki  ->  prettyurl
> 
> Tests:
> domain1.com/prettyurl/page/home  ->  /app1/plugin_wiki/page/home
> domain2.com/prettyurl/page/home  ->  /app2/plugin_wiki/page/home
> domain2.com/default/myfunc          ->  /app2/default/myfunc
> 
> This is such a standard requirement,  surely it cannot be so difficult??

The parametric router doesn't do renaming/aliasing at all, so at a minimum 
you'll need to do it with the pattern-matching router.

Note that you *could* use the parametric router successfully in the 
incoming-URL side, by translating request.controller early in your model. But 
there's no general mechanism to translate the other direction, so URL calls 
within plugin_wiki would generate untranslated URLs.

I'd be open to suggestions to allow some kind of outgoing URL hook. I think the 
code would have to live in routes.py, though, since URL can be called from 
anywhere (model, controller, view).

-- 



Reply via email to