On Wed, Oct 21, 2009 at 06:50 -0500, Chris Brannon wrote:
> 
> 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

Aha, this I did not know. My apologies for misinforming you. And by all
means, no need to apologise for correcting a mistake like this.  Thank
you for the clarification.

Greetings,

Hraban Luyat

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to