Change canonical URL of the main page to domain root
Open, Needs TriagePublic

Description

I'd like us to consider changing the canonical URL to a the main page of Wikimedia wikis to be the domain root.

E.g. instead of the urls being localised, like:

We'd have:

Advantages:

Implementation:

In terms of implementation, this is relatively straight forward in MediaWiki. We won't have to worry about how things are being cached and purged. MediaWiki allows changing the canonical url of a page through a hook.

This affects various things:

  • Purges for edits will automatically purge this new canonical url (squid purge uses the code path that triggers the hook).
  • The currently canonical url automatically becomes a redirect, per MediaWikis' url normalisation router.
  • Any links generated by the software to the main page (e.g. the logo anchor link) point to the new url.
  • Configuration variables in JavaScript like wgIsMainPage and server-side checks like Title::isMainPage() all work as expected.
Restricted Application added subscribers: StudiesWorld, Matanya, Aklapper. · View Herald TranscriptDec 2 2015, 1:08 PM
Krinkle set Security to None.Dec 2 2015, 1:08 PM
Krinkle added subscribers: Nikerabbit, ori, bd808 and 2 others.
Kghbln added a subscriber: Kghbln.Dec 2 2015, 5:53 PM
Restricted Application added a subscriber: JEumerus. · View Herald TranscriptJan 14 2016, 4:15 AM
TTO awarded a token.Jan 31 2016, 1:30 AM
Krinkle changed the title from "Change canonical URL of the main page to domain root." to "Change canonical URL of the main page to domain root".Feb 1 2016, 4:37 PM

Given T106793#2786334, the implementation needs to be rethought.

Honestly, I don't see how that is related. This is working well for all of my wikis where I am using it.

demon removed a subscriber: demon.Jan 27 2017, 2:42 PM

Honestly, I don't see how that is related. This is working well for all of my wikis where I am using it.

Yeah, but since part of that was reverted, while https://translatewiki.net/ still works (with canonical self-reference), https://translatewiki.net/wiki/Special:MainPage now works as well, and it's has its own rel-canonical reference, not pointing to / strangely.

I expected the redirect to no longer work and rel-canonical on the special page to be set to /, since that's what your hook configures on translatewiki, right?

Okay, I got it now. I haven't changed my configuration, so indeed the redirect to the canonical name is no longer happening.