OK, I don't know how but I missed Philip's post earlier: "Is the rewrite rule within a virtual host block?"
This was exactly the problem - where I was trying Fran's suggestion for my mod_rewrite issues, I had added a rewrite rule to a virtual hosts block in httpd.conf, but forgotten to remove it. Everything is now working as expected. Thanks again for all the help. Whenever I'm stuck, there are always people here to get me unstuck :o) On 31 July, 02:08, mdipierro <mdipie...@cs.depaul.edu> wrote: > can you post your routes.py? as an attachment plaese. > > On Jul 30, 5:02 pm, LB22 <latn.bl...@googlemail.com> wrote: > > > > > OK, so that seemed to make sense, and I tried it, but still got 500 > > errors. Looking at the log, it's apparently being caused by invalid > > syntax: > > > ERROR: root:Your routes.py has a syntax error. Please fix it before > > you restart web2py > > ...Target WSGI script '/.../apachewsgi_2/web2py/wsgihandler.py' cannot > > be loaded as Python module. > > > On Jul 30, 9:30 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > > > > On Jul 30, 2009, at 1:22 PM, LB22 wrote: > > > > > Use a named buffer... I'm not sure what you mean. Could you give me an > > > > example of how I could rewrite my code in a more prudent way? My way > > > > clearly isn't prudent or I wouldn't end with 500 internal server > > > > errors ;o) > > > > Rather than this: > > > > routes_in=( > > > ('/(([a-zA-Z0-9])*)$' , '/application/controller/function?variable=$1'), > > > ) > > > > this: > > > > routes_in=( > > > ('/(?P<args>([a-zA-Z0-9])*)' , '/application/controller/function? > > > variable=\g<args>'), > > > ) > > > > (The terminal $ on your pattern is harmless, but not needed.) > > > > BTW, question for someone who knows what they're doing: shouldn't > > > these, on principle, be raw strings? I know that \g isn't a Python > > > code, but still.... > > > > > Thanks > > > > > On Jul 30, 9:15 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > > > >> On Jul 30, 2009, at 12:56 PM, LB22 wrote: > > > > >>> 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 afterwww.domain.com/istreatedasa 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. > > > > >> So would I. > > > > >> The rewrite routine actually rewrites the match pattern, so it'd be > > > >> prudent (I think) to use a named buffer instead of $1, just in case. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---