OK, another question regarding routes.py (since I've started fiddling with it again)...
Is it possible to temporarily store a value passed to a function, then use that value in the rewrite? I'm trying to get it working but haven't got it right yet. Example: routes_in=( ('/value' , '/rewritten/path/to?variable=value') ) On Jul 30, 4:16 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > On Jul 30, 2009, at 8:02 AM, LB22 wrote: > > > > > > > I appreciate the responses Fran, but I don't, I still feel like > > there's something crucial missing here, something that I'm missing. > > I'm sure it shouldn't be this difficult (I have done simple domain > > redirects in the past). It would be a lot easier if I could routes.py > > url rewrites to work as I expect. Either way, with routes.py, or > > apache mod_rewrite, I'm pretty stuck. I just want to get this working > > one way or another. > > > So, coming back to routes.py, if I do: > > > routes_in( > > ('/func','/app/control/func'), > > ) > > > routes_out() > > > Should this work? I'm trying to understand why it doesn't. > > The routes.py rewriter implicitly wraps your pattern in ^pattern$, so > at a minimum you probably want to catch any arguments that follow / > func. For that matter, your pattern won't catch '/func/'. So you might > want something like > > ('/func','/app/control/func'), > ('/func/(?P<any>.*)','/app/control/func/\g<any>'), > > and > > ('/app/control/func)','/func'), > ('/app/control/func/(?P<any>.*)','/func/\g<any>'), > > (I'm sure that the issue with the trailing slash has a more elegant > solution, but I haven't found it yet. Hence my earlier question about > routes.py debugging.) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---