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

Mike Schinkel mikeschinkel at newclarity.net
Mon Mar 9 18:28:29 GMT 2009


"Casey Bisson" <casey.bisson at gmail.com> wrote:
>> Isn't a 404 the only semantically reasonable response?

Yes, that is arguable but I thought a lot about it before I posted the question. I've actually spent a lot of time studying HTTP and proper response codes for RESTful web services so I'm very aware the purposes of response codes. I also know that many times it is a judgment call and I agree this is an area where judgment could easily come into play.

While I will certainly concede the point if most others feel it is semantically reasonable here are the two ways to look at it:

1.) The lack of posts imply there is no valid resource at the requested URI, or
2.) The lack of posts is simply a reportable state for a valid resource at the requested URI.

The basic difference is deciding if zero is a valid number of posts and at what level in the application stack a 404 should be served. Should the website deliver a protocol error or display a valid page? Isn't a page that tells the user there are no posts for that month a valid resource? Isn't a 404 page that displays results specific to the known URL a little odd?

My instincts tell me that 404 should be served for pages that the server doesn't understand nor can't make any sense of and for pages that the server can decipher 200 should be served along with a valid representation that tells the visitor about the "zero" state. I'd be happy to explore creating a patch if this is something that the committers would agree to.

-Mike Schinkel
http://mikeschinkel.com/

----- Original Message -----
From: "Casey Bisson" <casey.bisson at gmail.com>
To: wp-hackers at lists.automattic.com
Sent: Monday, March 9, 2009 1:50:22 PM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Should Monthly Archive Pages ever return 404?


Isn't a 404 the only semantically reasonable response?

Something we probably all need to do is make our 404 templates more  
useful, though. In the context you describe, it could easily look  
ahead and back to the next month/year/period in which their are posts,  
while still returning a 404, for example.

--Casey

http://maisonbisson.com
http://scriblio.net

On Mar 9, 2009, at 1:42 PM, Mike Schinkel wrote:

> I've just noticed something that surprised me, that if I go to an  
> archive page for which there are no posts for a given month that I  
> get a 404 error which doesn't exactly provide a great user  
> experience for people hacking URLs. Should it (at least optionally)  
> return a 200 ok but visually there are no posts for that month?
>
> -Mike Schinkel
> http://mikeschinkel.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list