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

Pixline › Paolo Tresso supporto at pixline.net
Mon Mar 9 20:37:09 GMT 2009


Il giorno 09/mar/09, alle ore 20:03, Paul ha scritto:

> Mike,
>
> Trying to understand your issue with the 404 returned. Correct me if  
> I'm wrong. You really want the option to do something like the  
> search results return of the query returned no hits? Which my  
> understanding is not a 404.

That is not, but I think it's a slightly different use case.

- user search for something, which produces 0 results, but he's trying  
a legitimate action in WordPress. HTTP 200 with 0 results, maybe some  
post related to the search term.
- user try to get the third page of the archive of a category which  
have only 2 posts, or for a category which is not existent. This  
should be 404, until that URL have some content and will have a proper  
HTTP status code.

While 204 is a nice idea, I don't think it's acceptable either. Quote  
from the HTTP 1/1 RFC [1]:

[quote]
The server has fulfilled the request but does not need to return an  
entity-body, and might want to return updated metainformation. The  
response MAY include new or updated metainformation in the form of  
entity-headers, which if present SHOULD be associated with the  
requested variant.

If the client is a user agent, it SHOULD NOT change its document view  
from that which caused the request to be sent. This response is  
primarily intended to allow input for actions to take place without  
causing a change to the user agent's active document view, although  
any new or updated metainformation SHOULD be applied to the document  
currently in the user agent's active view.

The 204 response MUST NOT include a message-body, and thus is always  
terminated by the first empty line after the header fields.

[/quote]

Also, 404 is not the right answer, because all 4xx status suppose/ 
implies a client error, and that's not the case (even considered that  
most of 404's should be 410: Gone.).

Maybe the right way is 203, non- authoritative information, but this  
would be a really ample interpretation of the status code, and I'm not  
really sure about that. So, at this time 404 is probably the right  
choice (even if somewhat an ample interpretation of it), because the  
404 description says:

[quote]

This status code is commonly used when the server does not wish to  
reveal exactly why the request has been refused, or when no other  
response is applicable.

[/quote]



My 0,2€

Paolo / Pixline





[1]	http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html




More information about the wp-hackers mailing list