Thanks a lot.
It works fine. Surprisinly IE6.0 doesn't show me a "nice error" so I
can edit the new page, like in Firefox. ¿?
Javi
2007/3/29, Platonides <Platonides(a)gmail.com>om>:
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).
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l