From: Ori Livneh Date: Wed, 24 Jun 2015 03:21:16 +0000 (-0700) Subject: Revert r47388 / 8d9243cf3: Use Title::getLocalURL() for rel=canonical links X-Git-Tag: 1.31.0-rc.0~10994^2 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=6c3b7aa75fc700e85418761b499d73ec6acce256;p=lhc%2Fweb%2Fwiklou.git Revert r47388 / 8d9243cf3: Use Title::getLocalURL() for rel=canonical links Using relative links for is a missed chance to signal the preferred hostname and protocol for accessing our sites, which invites Google (and other search engines) to guess, or to treat the request URL's hostname as canonical. Compared to that, the number of bytes saved by using a relative link is insubstantial. Change-Id: I483b4425c1c14211e67bbb6e7ae077b7faa4ee25 --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 450251a851..053753e9bf 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1000,7 +1000,7 @@ class Article implements Page { $outputPage->addModules( 'mediawiki.action.view.redirect' ); // Add a tag - $outputPage->setCanonicalUrl( $this->getTitle()->getLocalURL() ); + $outputPage->setCanonicalUrl( $this->getTitle()->getCanonicalURL() ); // Tell the output object that the user arrived at this article through a redirect $outputPage->setRedirectedFrom( $this->mRedirectedFrom );