Last modified: 2014-07-16 11:36:21 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 T14345, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12345 - Server should return a 410 HTTP status code for deleted pages
Server should return a 410 HTTP status code for deleted pages
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Lowest minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-18 19:31 UTC by Tristan Miller
Modified: 2014-07-16 11:36 UTC (History)
2 users (show)

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


Attachments

Description Tristan Miller 2007-12-18 19:31:55 UTC
As per RFC 2616, MediaWiki should return a 410 HTTP status code (410 Gone) for pages which have been deleted.  This will assist search engines, link checkers, and other automated tools in removing links to wiki pages which no longer exist.  Note that MediaWiki can still display whatever web page it normally does when the user accesses a deleted page; it's just the HTTP status code which should be altered (from 200 OK to 410 Gone).

See also Bug 2585.
Comment 1 Antoine "hashar" Musso (WMF) 2007-12-20 18:35:11 UTC
410 is when you are sure the given page will no longer be served.
With lighttpd, the server does not even send the page content on a 410 error code.

Marking as wont fix :)


The patch for Article::getContent() if you ever want to try:

Index: includes/Article.php
===================================================================
--- includes/Article.php        (revision 28716)
+++ includes/Article.php        (working copy)
@@ -159,6 +159,12 @@
                        wfProfileOut( __METHOD__ );
                        $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
+                       if( $this->getTitle()->isDeleted() ) {
+                               $wgOut->setStatusCode( 410 );
+                       } else {
+                               $wgOut->setStatusCode( 404 );
+                       }
+
 			if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 				$ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
 			} else {

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


Navigation
Links