Javier Valcarce García escribió:
Hi,
Google has indexed a lot of pages in my wiki which I have deleted.
This pages continue in Google's index because index.php returns a
valid page "There is not a page called XYZ, click on edit to edit blah
blah blah".
How can I return HTTP 404 error if *an anonymous* user requests a
non-existent page?
Thanks in advance,
Javi
Go to article.php about line 146 (fiunction getContent()) and add
$wgOut->setStatusCode(404); This /should/ do it.
if ( 0 == $this->getID() ) {
wfProfileOut( __METHOD__ );
+ $wgOut->setStatusCode(404);
$wgOut->setRobotpolicy( 'noindex,nofollow' );
MediaWiki doesn't send 404 by default to avoid problems with
"intelligent" browsers showing "nice errors" hidding our content
(however, as wiki output is generally large enough it shouldn't be a
problem for you).