Ori.livneh has submitted this change and it was merged.

Change subject: Revert r47388 / 8d9243cf3: Use Title::getLocalURL() for 
rel=canonical links
......................................................................


Revert r47388 / 8d9243cf3: Use Title::getLocalURL() for rel=canonical links

Using relative links for <link rel=canonical> 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
(cherry picked from commit 6c3b7aa75fc700e85418761b499d73ec6acce256)
---
M includes/page/Article.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/includes/page/Article.php b/includes/page/Article.php
index 450251a..053753e 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1000,7 +1000,7 @@
                                $outputPage->addModules( 
'mediawiki.action.view.redirect' );
 
                                // Add a <link rel="canonical"> 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 );

-- 
To view, visit https://gerrit.wikimedia.org/r/220488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I483b4425c1c14211e67bbb6e7ae077b7faa4ee25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf11
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to