Help:Interwiki linking

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search

Interwiki links are links to pages of other projects, using a prefixed internal link style.

Interwiki links make it possible, to link to pages of (e.g.) Wikipedia, Wikibooks, Wikinews etc. or to your wiki-project in different languages (see Manual:Wiki family).

A link like [[Wikipedia:Main Page]] will appear like this: Wikipedia:Main Page and redirect you to Wikipedia's Main Page.

Interwiki links to other projects


Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. Note that wikipedia was only added as one of the interwiki defaults since v1.10

The following are some examples of interwiki prefixes which are available by default:

prefix destination URL usage example
commons [[commons:MediaWiki]]
mediazilla [[mediazilla:1209]]
meta [[meta:Main Page]]
mw [[mw:Help:Contents]]
wikibooks [[wikibooks:Main Page]]
wikimedia [[wikimedia:Main Page]]
wikinews [[wikinews:Main Page]]
wikiquote [[wikiquote:Main Page]]
wikisource [[wikisource:Main Page]]
wikispecies [[wikispecies:Main Page]]
wiktionary [[wiktionary:Main Page]]

Note: In some installations none of these is pre-installed. Try [[metawikipedia:Main Page]] in this case.

Adding a new website for interwiki linking

For setting up interwiki links, you might need to edit the database. Alternatively you might prefer to install an Interwiki extension.

(note: advanced mySQL users may prefer to use just a single command line: INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ; - instead of exporting and re-importing the whole table interwiki content... )

(Advanced users of PostgreSQL use INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', '$1', 1, 0);)

  • Export the database table 'interwiki' then add to the end of the table the following kayakwiki example...
  • ('kayakwiki', '$1', 1, 0);
  • Note: in the above code, the semicolon ';' as seen, MUST be at the end of the table. At the end of any other line within that table Only has ','.
  • Import the database table 'interwiki'
  • To test it: Go to your site, create an article, with the following content.
  • [[kayakwiki:Places|]] will display a link to the 'Places' page on (the url

As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).

The fields of the interwiki database table are as follows:

  • iw_prefix: choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia
  • iw_url: enter the project's URL, e.g.$1 for Wikipedia. Don't forget the $1 as it is replaced with the article's name you are linking to ([[Wikipedia:Main Page]] links to

Note: If iw_url is a binary BLOB field (SVN version, but also occurs in version 1.11.0, bug?) this won't work directly. You have to enter it as binary. There are two possible solutions: 1. You save the url in a plain text file, then import it through phpmyadmin. 2. You can directly enter an SQL query.

  • iw_local: if 1, your wiki will redirect even external links of the form iw_prefix:title, not only those from its own pages. you need this if you want to use the redirect functionality from outside your wiki or other wikis use your transwiki functions for nested transwiki links (like
  • iw_trans: "transwiki transclusion" - set to 1 if you want to use pages from the other wiki as templates. You will also need to set Manual:$wgEnableScaryTranscluding in your LocalSettings.php

See also