Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Interwiki linking
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Technical == {{see also|Wikipedia:Manual of Style/Self-references to avoid#Self-reference tools}} A project's own namespace prefix cannot be reused as code for an external project. However, the prefix used for a target project may coincide with the prefix for a project namespace, within that project. As a result, to link to a page in that namespace, use the same prefix twice. For portability across projects, one may want to select a link code that leads to the same target from all projects, for example: [[MetaWikipedia:wikibooks:Main Page]]. The "superfluous" "MetaWikipedia:" prevents "wikibooks:" being interpreted as namespace prefix, when the code is used at wikibooks itself, while at Meta the "MetaWikipedia:" is ignored (it is not a namespace prefix and even at Meta itself, it is recognized as code for Meta). The codes above work from all projects; however, the [[Help:Link#Wikilinks|existence detection]] and the [[Help:Self link|self-link feature]] do not work on interwiki links. === Prefixes === Interwiki links can use prefixes for the '''project''' and/or for the '''language'''. Without the prefix, links are local, for pages in the same project and the same language. If only a language is given, they go to a page in the same (or similar) project for the specified language: <nowiki>[[:fr:]]</nowiki> [[:fr:]] <nowiki>[[:os:]]</nowiki> [[:os:]] If only the project is specified, they typically go to the language of the source, see above. At most, two prefixes are needed for pages in any existing project and any supported language: <nowiki>[[s:de:Hauptseite]]</nowiki> [[s:de:Hauptseite]] <nowiki>[[b:en:Main page]]</nowiki> [[b:en:Main page]] In the case of more than one prefix, a page name has to be specified. For example, while [[w:]] and [[:en:]] from Meta lead to the English Wikipedia's main page, a bare <code><nowiki>[[w:en:]]</nowiki></code> does not work: [[w:en:]]. If the language is different, specifying it before the project can also work: <nowiki>[[:de:q:Hauptseite]]</nowiki> [[:de:q:Hauptseite]] <nowiki>[[:en:n:Main page]]</nowiki> [[:en:n:Main page]] <nowiki>[[n:en:Main page]]</nowiki> [[n:en:Main page]] The second example doesn't work from English Wikipedia <code>w:en:</code> pages; a project prefix before the language is better. More than two prefixes are generally unnecessary; the following examples should work everywhere: <nowiki>[[m:Help:Help]]</nowiki> [[m:Help:Help]] <nowiki>[[w:Interwiki]]</nowiki> [[w:Interwiki]] Two prefixes can have unexpected effects; for example, from [[m:|Meta]], the following links end up on different pages: <nowiki>[[m:en:About]]</nowiki> [[m:en:About]] <nowiki>[[:en:m:About]]</nowiki> [[:en:m:About]] <nowiki>[[m:About]]</nowiki> [[m:About]] In the first case [[m:|Meta]] ignores the <code>m:</code>, because it is local and then, interprets <code>en:</code> as <code>w:en:</code>, the prefix for the English Wikipedia. In the second case, the leading <code>en:</code> goes to the English Wikipedia, where the following <code>m:</code> goes straight back to [[m:About|Meta]]. The second example doesn't work at all, from English Wikipedia <code>w:en:</code> pages, only the third example works everywhere. In other words, multiple prefixes are evaluated left to right by the relevant Wikimedia servers (project and language). For projects without different languages, like [[m:|Meta]] (because Meta is multilingual by itself), language prefixes can be handled as shorthands for <code>w:</code> plus the specified language: <nowiki>[[:pl:2006]]</nowiki> [[:pl:2006]] <nowiki>[[w:pl:2006]]</nowiki> [[w:pl:2006]] <nowiki>[[:pl:w:2006]]</nowiki> [[:pl:w:2006]] From [[m:|Meta]], the first two links both arrive at the Polish 2006 page. The third arrives at the English [[w:|Wikipedia]], because that's how the server selected by <code>:pl:</code> interprets the second prefix <code>w:</code>. For a portable link on that server, it would be a bad idea to use <code>w:</code>, but <code>:pl:</code> does the trick. To test that effect from [[m:|Meta]], the following links should go to the same page: <nowiki>[[:ja:2006]]</nowiki> [[:ja:2006]] <nowiki>[[:ja:ja:2006]]</nowiki> [[:ja:ja:2006]] A universal interwiki link, that is, one that works no matter from which Wikimedia wiki, can be written <nowiki>[[m:</nowiki>''project'':''language'':''page name'']] (e.g. [[m:b:nl:Wiskunde]]); this routes the parsing of the links via Meta ([[bugzilla:4285|bug 4285]]). [[m:mos:Soraogo]] links the mos Wikipedia. MOS is a namespace at the English Wikipedia so <code><nowiki>[[mos:Soraogo]]</nowiki></code> would be a local link.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)