> What if people want to programmatically generate the notfound message,
> perhaps to see if the URL was a typo and suggest nearby URLs?
>
> What if people want notfound messages to have side effects, like be
> added to a database so they can see the most popular 404s and add
> redirects for them?
>
> What if people want different notfound messages for different applications?
If we support that then changing notfound message for a website may
involve setting notfound for each individual app that is used.
I think dynamic notfound message is a rare case and can be handled by
adding handler for .*.
urls = (
'/foo', 'foo',
'/(.*)', 'notfound'
)
app = web.application(urls, globals())
class notfound:
def GET(self, name):
web.ctx.status = '404 Not Found'
return 'Unable to find %s. Did you mean "foo"?" % repr(name)
Isn't this good enough?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---