From: Aaron Schulz Date: Wed, 25 Jun 2014 04:28:50 +0000 (-0700) Subject: Set noindex,nofollow on missing (404) pages X-Git-Tag: 1.31.0-rc.0~15216^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=360ba51b58db4a25ec9cc70270f6dcb50ce7d9c7;p=lhc%2Fweb%2Fwiklou.git Set noindex,nofollow on missing (404) pages * This used to be done until a0e83700a678dd813bf5173bac7f30e67d48c706 by mistake Change-Id: I77c96363e472c5cb87183ba7d6458241b76d8ed1 --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 967ca07aed..8a72815b3a 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1209,12 +1209,10 @@ class Article implements Page { $this->getContext()->getRequest()->response()->header( "HTTP/1.1 404 Not Found" ); } - if ( $validUserPage ) { - // Also apply the robot policy for nonexisting user pages (as those aren't served as 404) - $policy = $this->getRobotPolicy( 'view' ); - $outputPage->setIndexPolicy( $policy['index'] ); - $outputPage->setFollowPolicy( $policy['follow'] ); - } + // Also apply the robot policy for nonexisting pages (even if a 404 was used for sanity) + $policy = $this->getRobotPolicy( 'view' ); + $outputPage->setIndexPolicy( $policy['index'] ); + $outputPage->setFollowPolicy( $policy['follow'] ); $hookResult = wfRunHooks( 'BeforeDisplayNoArticleText', array( $this ) );