[wp-hackers] Should Monthly Archive Pages ever return 404?

Mike Little mike at zed1.com
Mon Mar 9 23:05:10 GMT 2009

2009/3/9 Mike Schinkel <mikeschinkel at newclarity.net>:
> "Mike Little" <mike at zed1.com> wrote:
>> I would disagree. From a user's point of view, they should
>> expect a user friendly response. Which might not be the
>> same as 'valid'
> Agree, but what is currently presented (404 Not Found) is decidedly NOT a user friendly response.
>> One such response is, as I've suggested "what you gave me
>> was invalid, but here is something that is useful to you."
>> That's human level semantics.
> That's what we are proposing, but that doesn't require a 404 be generated. 404 is more properly a protocol error not an application level response.

Actually 404 *is* an application level protocol response.

"The Hypertext Transfer Protocol (HTTP) is an application-level
protocol for distributed, collaborative, hypermedia information

-- from RFC2616

That's why I mentioned the server to browser part. That part must say
"what you gave me was invalid", that's what 404 is for. Otherwise my
'absurd' search engine scenario *will* (and does) happen.

But, you can of source present something nicer to the user.

>> Machine level (server to browser)  should either be "I
>> couldn't find what you asked for. Show this to your human"
>> (404 with content) or "I couldn't find what you asked for,
>> go here instead" (302)
> That's a false dichotomy. Presenting a 404 means "Resource Not Found" when the valid resource to serve is "There are no posts here."  That should get a 200.

That only holds if an "archive" with our without posts is something
WordPress considers content. It very clearly does not, and nothing in
it's history or future indicates it will.

And we are still back to the idea that every possible "archive" becomes valid.

Even if you restrict it to "date of earliest post until now" that is
still a lot of  'valid' URLs with no content.

This blog, (which used to be WordPress) http://www.pepysdiary.com/
would have over 124,000 such empty URI's  (127,000 possible days,
versus 3285 maximum diary entries)

>> Remember WordPress only 'does' posts, pages, and links, they are
>> it's only content.
> That's an extremely narrow viewpoint that will be proven wrong with almost 100% certainty as WordPress evolves.

It's not a viewpoint it's a fact based on exactly what the code does
at this moment in time.

> Again at this point I am not trying to impose this on others but there should be an easy way for a themer or plugin dev to make it so.

As I mentioned there *is* an easy way to divert the standard 404
response and present a different one.

Mike Little

More information about the wp-hackers mailing list