Last modified: 2006-01-06 00:35:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T6479, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 4479 - Wikitravel broken interwiki
Wikitravel broken interwiki
Product: Wikimedia
Classification: Unclassified
Interwiki links (Other open bugs)
PC All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: 4480 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2006-01-04 15:05 UTC by Walter Vermeir
Modified: 2006-01-06 00:35 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Walter Vermeir 2006-01-04 15:05:39 UTC
[[wikitravel:en:Main Page]] works
[[wikitravel:Main Page]] works
[[wikitravel:nl:hoofdpagina]]  does not work
[[wikitravel:de:Hauptseite]] does not work

The problem seems to be that [[wikitravel:*]] points to and not to
Comment 1 Brion Vibber 2006-01-04 15:07:19 UTC
We don't run Wikitravel; let the Wikitravel admins know their interwiki redirection is broken.
Comment 2 Walter Vermeir 2006-01-04 15:26:14 UTC
I know Wikitravel is not a Wikimedia project. 

I have asked there about the problem and the responds there was "Looks like a bug in Wikipedia's 
configuration (the root url should be /, not /en/). A mail to the Wikipedia admins should suffice to 
fix this. It's not a Wikitravel bug though.."

Comment 3 Zigger 2006-01-04 15:30:21 UTC
*** Bug 4480 has been marked as a duplicate of this bug. ***
Comment 4 Brion Vibber 2006-01-04 16:42:57 UTC
(Whoops, commented on the dupe instead of this one by mistake.)

That wouldn't work.

Working URLs: -> english wiki -> french wiki

URL as created by our current interwiki for wikitravel:
-> english wiki
-> redirect to english wiki
-> 'bad title'

It looks like they don't have their system set up to redirect their local 
interwikis properly, so the non-English one fails with a bad title error.

URLs as would be created by the recommendation given on Wikitravel bug reports:
-> 404 error
-> 404 error
-> 404 error

That would break *every* interwiki link to Wikitravel, so sounds less than ideal.
Comment 5 Evan Prodromou 2006-01-04 18:25:06 UTC
This isn't a Wikitravel problem, Brion. It's a problem with Interwiki syntax
that Wikimedia sites have worked around and Wikitravel has not (yet).

The problem is that we've built up an expectation that [[project:language:page]]
is going to correctly map to the page on a particular project and language
version, but currently Mediawiki can't handle the correct transformation.

The workaround on Wikimedia sites right now seems to be that language:page will
redirect to the correct project+language for any language version. That's a
clever workaround, but it would probably be better to make the interwiki syntax
actually aware that we've extended it to included a language code.

So wikipedia: as an interwiki prefix might map to an url like
http://$$1, where $2 is the language code, and $1 is the
page name. I suggest $2 since we already use $1 for the page title. For
Wikitravel it'd be$2/$1. It'd probably be a good idea to
have $2 default to the current wiki's content language code, so
wikitravel:France would go to wikitravel:fr:France if it's added on wikipedia:fr
and wikitravel:en:France if it's added on wikipedia:en.

It's not an ideal fix, but neither is this other workaround.

Probably the easiest workaround would be to use wikitravel-fr:, wikitravel-de:,
etc. as prefixes, rather than abusing the colon yet again.
Comment 6 Evan Prodromou 2006-01-04 18:42:33 UTC
Argh! No, it's a Mediawiki bug. Here's the erroneous lines from index.php (v 1.4.x):

        $url = $wgTitle->getFullURL();
        # Check for a redirect loop
        if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) &&
$wgTitle->isLocal() ) {
                $wgOut->redirect( $url );
        } else {
                $wgTitle = Title::newFromText( wfMsgForContent( 'badtitle' ) );
                $wgOut->errorpage( 'badtitle', 'badtitletext' );

It assumes that the difference between language versions is always going to be
the hostname -- a good assumption for Wikimedia sites where that's the norm, but
not necessary and not built into the software. For example, on Wikitravel the
hostname is always "".

It'd probably just be smarter to check that the interwiki prefix isn't the
default local one! Something like:

       if ($wgTitle->isLocal() && $wgTitle->getInterwiki() != $wgLanguageCode &&
$wgTitle->getInterwiki() != $wgLocalInterwiki) {

Another mechanism might be to use $wgArticlePath as a regexp (s/$1/(.*)/) and
see if the full URL matches.

Anyways, I'm going to hack in the check for language code and local interwiki
above and see how that works out.
Comment 7 Evan Prodromou 2006-01-04 19:03:13 UTC
OK, so, with the above path now redirects to, but the interwiki links at the top of this
page don't seem to work (even the ones that were supposed to work when the bug
was filed!).

To be honest, I'm not sure why the above redirect loop check is necessary, since ->, w/o
an interwiki prefix. I'm not sure how a loop would happen unless the interwiki
table were set up incorrectly (say, iw_prefix = 'en' had iw_url =
Comment 8 Evan Prodromou 2006-01-04 19:06:00 UTC
OK, so, the links above work if actually embedded in a page on wikipedia:en. I
think this bug is fixed.
Comment 9 Brion Vibber 2006-01-05 12:38:10 UTC
I think the loop check is to prevent the case where you #redirect.

If this still seems to be working, go ahead and commit the fix.
Comment 10 lɛʁi לערי ריינהארט 2006-01-06 00:35:45 UTC

This bug / report / enhancement request reminds me on
Bug 4285: provide accessibility of Wikipedia's sister projects trough wikipedia:
interwiki prefix

Please take a look at where
[[wikipedia:commons:User:Gangleri]] is used (but does not work at wikitravel)
beside [[wikipedia:meta:User:Gangleri]] (which works fine at wikitravel).

- At "commons:" is a interwiki prefix to the projects shared file
repository and not to WikiMedia foundations [[commons:]] wiki.
- At there is no interwiki prefix "meta:".

Of course there is the question which interwiki prefixes should be "forwarded"
and which not. Probably a new field in the table should indicate if the prefixes
are in the same project / same super-project / same farm. This field (and
addtional configuration options) should influence the "decision".

best regards reinhardt [[user:gangleri]]

P.S. Please note that [[wikitravel:commons:Main Page]] directs properly at
[[en:]] and probaly here also.

Note You need to log in before you can comment on or make changes to this bug.