OK, so I have a new question. After all of the above I was experimenting this afternoon with masking urls (not for anything dodgy, I assure you). I'm wondering though, why does the below provide the work as designed on my local machine ("localhost"), but not work when on the remote server?
routes_in=( ('/(([a-zA-Z0-9])*)$' , '/application/controller/function?variable= $1'), ) routes_out=() What's meant to happen is that any string of alphanumeric characters entered after www.domain.com/ is treated as a value to be passed on to a function. If there is a trailing slash (or some other non- alphanumeric character) it fails to match and url remains as is. Like I said, I'm just experimenting here, but I'd like to understand what is going wrong. On Jul 30, 8:29 pm, LB22 <latn.bl...@googlemail.com> wrote: > Sorry, please disregard the above question... > > Thanks you Fran for the help with apache mod_rewrite, and thank you > Jonathan for your help on with that and routes.py. Much > appreciated. :o) > > On Jul 30, 8:19 pm, LB22 <latn.bl...@googlemail.com> wrote: > > > > > 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 -~----------~----~----~----~------~----~------~--~---