From 6c3b7aa75fc700e85418761b499d73ec6acce256 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Tue, 23 Jun 2015 20:21:16 -0700 Subject: [PATCH] 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 --- includes/page/Article.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); -- 2.20.1