MediaWiki User Guide/Hyperlinks

From Wikibooks, open books for an open world
Jump to: navigation, search

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

Internal hyperlinks[edit]

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]]'''

External hyperlinks[edit]

Task Markup Note
External hyperlink [URL_containing_no_spaces title of the URL]

Redirecting[edit]

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 ":":

#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.