Page MenuHomePhabricator

Set up and test the pretty URLs for Wikidata
Closed, ResolvedPublic

Description

As per the specification on https://meta.wikimedia.org/wiki/Wikidata/Notes/URI_scheme#Proposal_for_Wikidata

Set up for 4 languages (en, de, hu, he) and set all appropriate rewrite and redirect rules.


Version: unspecified
Severity: normal
Whiteboard: storypoints: 5

Details

Reference
bz40389

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:02 AM
bzimport set Reference to bz40389.
bzimport added a subscriber: Unknown Object (MLST).

External factor: Our colleague who is currently on vacation has to set up the language subdomains for us.

I skipped the middle part of the specification. The following links are now redirected to the item Helium:

en.wikidata-dev-repo.wikimedia.de/wiki/Helium
de.wikidata-dev-repo.wikimedia.de/wiki/Helium
he.wikidata-dev-repo.wikimedia.de/wiki/%D7%94%D7%9C%D7%99%D7%95%D7%9D
hu.wikidata-dev-repo.wikimedia.de/wiki/Hélium

en.wikidata-dev-repo.wikimedia.de/title/Helium
de.wikidata-dev-repo.wikimedia.de/title/Helium
he.wikidata-dev-repo.wikimedia.de/title/%D7%94%D7%9C%D7%99%D7%95%D7%9D
hu.wikidata-dev-repo.wikimedia.de/title/Hélium

The reasons why I skipped the first step (redirect to http://wikidata-dev-repo.wikimedia.de/title/enwiki:Helium): The part "enwiki:Helium" is addressed as one single entity and I didn't find a way to separate them. (Trials are commented out in /etc/apache2/sites-available/wikidata-dev-repo.wikimedia.de)

Thx for the feedback - now both parts are applied. You won't see it, when the item is loaded, you get a URL like http://wikidata-dev-repo.wikimedia.de/wiki/Data:Q3 -> was this what we wanted?

Thanks Silke!

Seems to work so far, though it's not quite what is specified in https://meta.wikimedia.org/wiki/Wikidata/Notes/URI_scheme:

<en.wikidata-dev-repo.wikimedia.de/wiki/Helium> correctly redirects to http://wikidata-dev-repo.wikimedia.de/title/enwiki:Helium, but that should then be a rewrite, not a redirect, to http://wikidata-dev-repo.wikimedia.de/wiki/Special:ItemByTitle/enwiki/Helium.

That only requires a small change to the rewrite rule: Use the local web path, not the full url, as the target, and use the [L] (last rule) instead of the [R] (redirect) option.

Oh, btw: I think both rewrites and redirects should use the QSA (querry string attach) flag. That causes query parameters like setlang=en to be passed on to the target address. Without QSA flag, query parameters get stripped.

OK, I applied these changes. Nevertheless, calling the Special:ItemByTitle seems to redirect to http://wikidata-dev-repo.wikimedia.de/wiki/Data:Q3. This is not due to the rewrite rules any more.

Verified in Wikidata demo time for sprint 18