Hraban Luyat <[email protected]> wrote: > > On Tue, Oct 20, 2009 at 07:53 -0700, Alessandro Agosto wrote: > > This is my urls scheme: > > urls = ( > > '/(.*)/','Redirect', > > '/', 'Home', > > '/s', static.app_static, #it handle request for static contents > > '/search', 'Search', # this url does not work > The URL matchers are regular expressions that are matched against the > start of the URL. To exlicitly indicate an end (in any regular > expression, this is not web.py specific) of the match, you need the '$' > character: '/s$'.
Sorry to be pedantic, but this isn't quite right. The regexps are anchored when they are compiled, so there's no need to specify an explicit anchor while using web.py. Have a look at the _match method of the application class. If you have the web.py 0.32 source handy, it's web/application.py, line 418. The OP's urls scheme specified a sub-application reached by a path of /s. Sub-application paths aren't regexps. They're matched with path.startswith. In other words, _match passes the request to a sub-application if the subapp's path is a prefix of the request's path. Hence, changing /s to /s/ fixed the problem for the original poster. -- Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
