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
$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 );