handling 404

will kahn-greene <[email protected]> Mon, 14 Jun 2010 13:16:09 -0400
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
A month or two ago someone asked on #pyblosxom about how to get
PyBlosxom to do something different when faced with a 404 situation.

Today, chorse asked essentially the same question.

I was thinking about creating a callback.  PyBlosxom would do its thing
and then at the point where it's about to throw an HTTP 404, it would
call this 404 handling callback.  Plugins could implement the callback
and do whatever.  If no plugins handle the callback, then PyBlosxom
would default to doing what it does now: create a fake "No entries by
that name" kind of entry and render it in a story template.

I thought I'd ping the list to see what 404 handling plugins would want
to do so as to best implement this.

Is it sufficient for the 404 handling plugin to return a fake entry that
gets rendered in the blog's theme with navigation links and bars and all
that?  This fake entry could override which template to use.

Would people rather have a 404 handling plugin render the 404 page such
that when it returns and tells PyBlosxom it's handled the 404, PyBlosxom
doesn't do anything more with the request?

Are there other situations (500?  403?  ...) that would want to get
handled in a similar way such that we'd want to abstract this into
something more general?

Any and all thoughts are appreciated--treat this as an exploratory
fishing expedition.

/will

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo