Last modified: 2011-01-15 22:00:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28729, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26729 - Deleted or never-existed categories to return HTTP 404 Not Found
Deleted or never-existed categories to return HTTP 404 Not Found
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-14 17:52 UTC by Roger W Haworth
Modified: 2011-01-15 22:00 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roger W Haworth 2011-01-14 17:52:48 UTC
When a category (has been deleted or has never existed) and it has no members (ie. there are no articles in the category) then an HTTP 404 code should be returned.

Consider http://webcache.googleusercontent.com/search?q=cache:tA61J-kDRkMJ:en.wikipedia.org/wiki/Category:Elysiidae which is Google's cache of en:Category:Elysiidae. Google is continuing to report it even though the category was deleted more than two years ago. It is reported because a status code of 200 OK is returned. Presumably the idea of that was to allow for categories with members but without a category page.

Suggested solutions:

Solution 1 - cheap and, in my view, completely satisfactory. Forget the "no members" criterion. Return a 404 Not Found code for every category where no page exists. Most browsers completely ignore the difference between a 200 and a 404 code - an human viewing a category with members but with no page will see the information and never know that a 404 was returned. Search engines seeing such a page will honour the 404 and not index - is that any great loss?

Solution 2 - rigorous. For a category where no page exists, check first if it has members and send 200 or 404 as appropriate.
Comment 1 MZMcBride 2011-01-14 17:55:49 UTC
Is this a duplicate of bug 2585?
Comment 2 Roger W Haworth 2011-01-14 18:06:25 UTC
Bug 2585 is a bit long in the tooth and has already been implemented certainly for the (article) namespace and probably for all except category. Also the question of "no page but has members" is unique to categories. So I felt that a fresh discussion might help. Incidentally see http://en.wikipedia.org/wiki/User_talk:RHaworth/Archive_to_2011_Jan_14#Category:Wikipedia_sockpuppets_of_.E2.80.A6 which is where I got involved - one person fussing over being accused of sock-puppetry.
Comment 3 Liangent 2011-01-14 19:09:37 UTC
I remember MSIE has an option which decides whether a standard (included in MSIE distribution) page or the page sent together with HTTP 404 should be used when it meets HTTP 404.
Comment 4 Bawolff (Brian Wolff) 2011-01-15 21:19:21 UTC
Note, as it stands (in trunk), categories will return a 404 if the following 3 conditions are met:
*The category page doesn't exist
*There are currently no articles in the category
*There never was any articles in the category (or to be technical, there is no entry in the category table)

It would be trivial to make the check be the category page doesn't exist and there are currently no articles in the category, if we want to do that.

(In reply to comment #3)
> I remember MSIE has an option which decides whether a standard (included in
> MSIE distribution) page or the page sent together with HTTP 404 should be used
> when it meets HTTP 404.

I believe that only happens if the body of the response is less than 512 bytes. Presumably most of our pages are above that threshold. In any case we already do this for articles, so I can't imagine its an issue
Comment 5 Bawolff (Brian Wolff) 2011-01-15 22:00:22 UTC
fixed in r80406

As a note. If you're editing a category (like any other page), you will get a 200 status code.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links