Jump to content

MediaWiki User Guide/Hyperlinks

From Wikibooks, open books for an open world

There are two types of hyperlinks in MediaWiki: internal, also called wikilinks, and external.

[edit | edit source]
Task Markup Note
Internal hyperlink [[keyword]]
Internal hyperlink 2 [[keyword]]s
Internal hyperlink to a section [[keyword#section_heading|link title]]
Internal hyperlink showing a different word [[keyword|its appearance]]
Internal hyperlink with a tooltip [[keyword|<span title="A tooltip">its appearance</span>]]
Internal hyperlink in bold '''[[keyword]]'''
Internal hyperlink to a diff/edit [[Special:Diff/(diff-number)]]
Internal hyperlink to a revision [[Special:Permalink/(revision-number)]]
[edit | edit source]
Task Markup Note
External hyperlink [URL_containing_no_spaces title of the URL]

Redirecting

[edit | edit source]

Readers and editors from different backgrounds search for the same topic under different titles, such as TODO. To avoid replication of similar content and confusion of editors and readers, the editors of a wiki website usually choose one topic title as the authorized one, under which the content is to be created, and let one or more alternative topic titles redirect to it.

To let a page title redirect to another one, create a page with the unauthorized (or minor) title, containing only the following text:

#REDIRECT [[Authorized topic title]]

An alternative markup; notice the additional colon (":"):

#REDIRECT: [[Authorized topic title]]

If an unauthorized topic title has more possible target authorized topic titles, redirecting does not do. In that case, a disambiguation page can be created, such as:

 The term '''unauthorized term''' may refer to:
 * [[Authorized topic title 1]]
 * [[Authorized topic title 2]]

The exact wording depends on the kind of content of the wiki website.

Further reading

[edit | edit source]