Page MenuHomePhabricator

Add short permalink route for revision oldid (e.g. /revision/123)
Closed, DeclinedPublic

Description

Our current permalinks are kinda ugly...

Particularly for non-ASCII bits the title portion of a link can be hugely ugly (all URL encoded) and hard to type in by hand, making a clean ID-based permalink easier to use from print.

eg from:
http://en.wikipedia.org/w/index.php?title=Main_Page&oldid=251850832
->
http://en.wikipedia.org/revision/251850832

or:
http://hi.wikipedia.org/w/index.php?title=%E0%A4%B8%E0%A5%82%E0%A4%B0%E0%A5%8D%E0%A4%AF%E0%A4%B5%E0%A4%82%E0%A4%B6%E0%A5%80_(1992_%E0%A4%AB%E0%A4%BC%E0%A4%BF%E0%A4%B2%E0%A5%8D%E0%A4%AE)&oldid=188492
->
http://hi.wikipedia.org/revision/188492

(A $wgActionPaths entry or similar can provide the exact path, as long as we've got some shorter way to do this standard.)

cf bug 16428 asking to put permalinks in the print version footer.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=851
https://bugzilla.wikimedia.org/show_bug.cgi?id=17981

Details

Reference
bz16659

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:28 PM
bzimport set Reference to bz16659.
bzimport added a subscriber: Unknown Object (MLST).

FYI: IRC feeds already make links as domain.tld/scriptpath/index.php?oldid=####. Is there any reason why the title could not be dropped in this case too?

?oldid good enough. Done in r45343

Re-opening. Original poster was looking for prettier links. /w/index.php?oldid= is not pretty.

matthew.britton wrote:

(In reply to comment #5)

Re-opening. Original poster was looking for prettier links. /w/index.php?oldid=
is not pretty.

Agree that http://en.wikipedia.org/w/index.php?oldid=123456789 is not sufficiently pretty.

The following two also work, though:

http://en.wikipedia.org/?oldid=123456789
http://en.wikipedia.org/wiki/?oldid=123456789

They're pretti*er* and I think the best we can do as a default, but not as pretty as I'd like. :)

Note that something like:

http://en.wikipedia.org/?oldid=123456789

can be achieved with the current code by setting $wgScript to a shorter value.

I think I'm more interested in $wgActionPaths support, allowing for customized rewriting for the site's local setup.

Say, something like:

$wgActionPaths['oldid'] = '/revision/';

leading to:

http://en.wikipedia.org/revision/123456789

Since oldid isn't an action parameter, this'd still require special casing in the actual URL generation.

dlancaster1 wrote:

There is a downside to making permalinks shorter though. Now you can't tell the page title by looking at it. Excepting the long-ASCII example, I don't think this is more useful. I use permalinks to reference or read articles in the state I found them, and now I have to copy the article name separately.

I would prefer for this bug to be reversed, as it reduces the usefulness of the permalink.

If it's primarily about the long-ASCII example, could the permalink include the title unless there were 10+ ASCII conversions?

(In reply to comment #2)

FYI: IRC feeds already make links as
domain.tld/scriptpath/index.php?oldid=####. Is there any reason why the title
could not be dropped in this case too?

Note that the IRC feed wasn't really changed for "prettyness" but because the title was already included elsewhere in the IRC messages, it was removed to save space by reducing duplication.

It perhaps makes sense here to distinguish between the permalink on the "Permalink" on the sidebar, and the link that's listed in printable view.

The printable view gets particular benefit from having a short link which can be typed by hand; a clickable permalink may be used online and not have as much of a requirement.

matthew.britton wrote:

Juat a note that a few people seem to be dissatisfied with the removal of the page title from 'permanent link' URLs: [[Wikipedia:Village pump (technical)#Permanent links and page titles]]

pixelface.bug wrote:

(In reply to comment #12)

Juat a note that a few people seem to be dissatisfied with the removal of the
page title from 'permanent link' URLs: [[Wikipedia:Village pump
(technical)#Permanent links and page titles]]

That was me Gurch. I've created an account here.

I would like the "Permanent link" hyperlink in the left sidebar toolbox to show the title field like it previously did before r45343 to SkinTemplate.php.

(In reply to comment #8)

Excepting the long-ASCII example, I don't think this is more useful.

I agree with what MeekSaffron said.

And regarding bug 16428, oldids still aren't visible when printable=yes. So perhaps if or when oldids do become visible in the print version footer, then the devs can prettify the printfooter permalinks.

These both look nice:
http://en.wikipedia.org/?oldid=260905624
http://en.wikipedia.org/revision/260905624

If you don't want to undo r45343, perhaps an additional line could be added to the toolbox so it displays:
Short permament link ---> http://en.wikipedia.org/w/index.php?oldid=260905624
Titled permanent link ---> http://en.wikipedia.org/w/index.php?title=Main_Page&oldid=260905624

If the software treats all permalinks the same, could it be modified to distinguish between untitled and titled permalinks (or toolbox permalinks and printfooter permalinks)? I apologize if I've crossed bugs at all, or if my suggestions merit a new bug report.

This hasn't been very popular so far, and is still incomplete. Pulling back for now in r46290 on trunk, r46291 on 1.14 branch.

  • Bug 21111 has been marked as a duplicate of this bug. ***

(In reply to comment #17)

I use something similar on my wiki
http://www.wecowi.de/wiki/Hauptseite

Those are not permalinks but "action paths", the "Permanenter Link" on your wiki goes to http://www.wecowi.de/index.php?title=Hauptseite&oldid=114938 as well

Adding dependency on bug 23489. Otherwise the page resulting from a permalink to a hidden/deleted revision will be crippled (since title would default to useless "Main Page" and has no way of getting to the title).

Just to note, there's now a Special page for permalinks: [[Special:PermanentLink/12345]].

Okay, why can't we have Apache internally rewrite https://hi.wikipedia.org/revision/188492 into https://hi.wikipedia.org/w/index.php?oldid=188492 and have MediaWiki interpret it as a GET request for an oldid parameter?

(In reply to TeleComNasSprVen from comment #21)

Okay, why can't we have Apache internally rewrite
https://hi.wikipedia.org/revision/188492 into
https://hi.wikipedia.org/w/index.php?oldid=188492 and have MediaWiki
interpret it as a GET request for an oldid parameter?

First note, don't use Apache rewrites for this, MediaWiki's path router can be made to handle urls like that internally.

And the answer to your question seems to be this earlier note:
(In reply to Krinkle from comment #19)

Adding dependency on bug 23489. Otherwise the page resulting from a
permalink to a hidden/deleted revision will be crippled (since title would
default to useless "Main Page" and has no way of getting to the title).

Krinkle renamed this task from Prettify permalinks to Add short permalink route for revision oldid (e.g. /revision/123).Jan 26 2019, 7:02 AM
Krinkle removed a project: OKR-Work.
Krinkle removed a subscriber: wikibugs-l-list.
Krinkle closed this task as Declined.EditedJan 26 2019, 7:19 AM

Closing as redundant in light of T60727, which now offers Special:Redirect/page/12345 (page id), and Special:Permalink/123456 (revision id). That seems good enough?

Long term, see also:

  • T201967 for a proposal to more generally shorten the urls to special pages.
  • T44085 for a url shortener that can shorten any given url.