Perhaps I'm misreading your answers, but now I'm more confused. I'll keep bumping my head till I figure out a way or else use apache's mod_rewrite which is a heck lot more straight forward.
I would suggest the following behavior though: routes_in and routes out in the _base_ routes.py should be completely ignored if routes_app is not commented out. routes_app should be always completely ignored in _app-specific_ routes.py This way there is no overlap and no confusion. Having so many contingents for routing makes it a lot more complex than it should. My 2c On Tue, Mar 20, 2012 at 11:34 AM, Anthony <abasta...@gmail.com> wrote: >> I'm definitely confused with this routing scheme. >> >> There's the base routes.py (which is usually ignored due to file >> name). > > Note sure what you mean -- if you have a /web2py/routes.py file, it will not > be ignored. web2py comes with two example files, routes.parameter_example.py > and routes.pattern_example.py -- of course they are ignored, as they are > intended only as examples (as the filenames suggest). > >> >> Inside this file there are 3 examples (routes_app, routes_in >> and routes_out). So, assuming you change the name of the file >> routes.py and restart your server, it will use routes_app (and will it >> ignore routes_in and _out?). > > Yes, but it will only ignore routes_in/routes_out if the incoming request > does not match anything in routes_app. Importantly, though, everything in > that file is just an example -- you're supposed to customize it to suit your > particular routing needs. Don't just use it as is. > >> >> If I comment out routes_app in that file, >> I should be picking up my patterns_in and patterns_out, but how would >> it then know the top level (app) routing? > > Not sure what you mean. If you don't have any routes_app (which would tell > web2py to look for and use the routes.py file in the application folder when > the incoming request matches a particular application), it will simply use > routes_in/routes_out for all rewriting (across all applications). > > Anthony