Help:Redirect: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
m Reverted changes by 204.108.212.220 (talk) to last version by Mtarch11
(294 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
<languages />
{{H:h|editor toc}}
{{ambox|text=<translate><!--T:1--> For technical documentation about redirects, please visit [[<tvar name=1>mw:Special:MyLanguage/Help:Redirects</tvar>|dedicated help page on Mediawiki.org]].</translate>}}


<translate>
For policy on the use and abuse of redirects on the English Wikipedia see [[w:Wikipedia:Redirect]].
<!--T:2-->
'''Redirects''' have different use cases through Wikimedia wikis.


== Local policies == <!--T:3-->
See also: [[MeatBall:PageRedirect]], [http://www.disinfopedia.org/wiki.phtml?title=Project:How_to_use_redirect_pages Disinfopedia: redirect policy]


<!--T:4-->
== What is a redirect? ==
Some projects have policies on ''what'' redirects should exist. For example, on the [[<tvar name="1">wiktionary:</tvar>|English Wiktionary]], most redirects are prohibited by policy.


=== Broken redirects === <!--T:5-->
A redirect is a page with no other content than something of the form


<!--T:6-->
<nowiki>#</nowiki>REDIRECT ''link in internal link style''
On many wikis administrators simply delete them, but it is sometimes useful to keep a broken redirect and wait for the creation of the target, or to set a new target.


== Purposes of a redirect == <!--T:7-->
If the link is to an existing page in the same project, going to the redirect (by means of a link, the URL, or the Go button) results in the new page, just like following the link, except that the browser shows the original URL, and the new page shows a redirection message below the title. (To get the canonical URL in your browser's address bar, click the article tab.)
</translate>
* <translate><!--T:8--> Allow access in the case that a page name is provided:</translate>
** <translate><!--T:9--> which is an alternative name for the subject</translate>
** <translate><!--T:10--> which is a name for a subtopic (in this case one may use a redirect to a section)</translate>
** <translate><!--T:11--> which uses alternative capitalization and hyphenation</translate>
** <translate><!--T:12--> which uses alternative spelling</translate>
** <translate><!--T:13--> which has a common misspelling</translate>
* <translate><!--T:14--> Provide a way of conveniently going to a page (shortcut).</translate>
* <translate><!--T:15--> Keep links to a page active after it has been moved (even if internal links are updated, this still applies for links from outside; also for [[<tvar name="1">Special:MyLanguage/Help:Edit summary#Internal and interwiki links in edit summaries</tvar>|links in edit summaries]]).</translate>


<translate>
For example, if somebody goes to: [[Help:Redirection]], then they will end up at this page instead, and the top of the page will look like:
=== Special purposes === <!--T:16-->
</translate>
* <translate><!--T:17--> Conveniently linking indirectly to a page, without the need for a [[<tvar name="1">Special:MyLanguage/Help:Piped link</tvar>|piped link]]. However, a piped link is in some respects even better than relying on a redirect.</translate>
* <translate><!--T:18--> Allowing a link title independent of the final link target; one creates a page whose name is the desired link title, and which redirects to the desired target page. See e.g. <tvar name="q">[[w:Template:Ft]]</tvar>, containing <tvar name="2"><nowiki>[[30.48 cm|ft]]</nowiki></tvar>, with the page <tvar name="3">[[w:30.48 cm]]</tvar> redirecting to <tvar name="4">[[w:Foot (unit of length)]]</tvar>. The link title "<tvar name="5">30.48 cm</tvar>" informs in the hover box about the unit "ft" even without following the link to the article about this unit. See also <tvar name="6">{{ll|Help:Advanced editing}}</tvar> for another technique with a similar result.</translate>


<translate>
<blockquote style="background-color: white; color: black; border:1px solid black; padding: 1em;">
<!--T:19-->
<h1 class="firstHeading">Help:Redirect</h1>
When creating new redirects, bear in mind that creating too many redirects can clutter up the [[<tvar name="1">Special:MyLanguage/Help:Searching</tvar>|search results page]], which can hinder users. Also, don't spend too much time creating redirects. Often it's more important to spend time improving the quality of the target page. A piped link is another way to make a link to a page with a name which does not occur in the first page.
<h3 id="siteSub">From Meta</h3>
<div id="contentSub">(Redirected from [[Help:Redirection]])</div>


== Using redirects for inexisting but expected pages == <!--T:20-->
''(etc)''
</blockquote>


<!--T:21-->
If the link is to a non-existing page in the same project, or to a page in another project, one simply arrives at the redirect page.
When an inexisting page Subtopic could be created as a subtopic of Topic page, there are the following possibilities:
</translate>
# <translate><!--T:22--> Redirect Subtopic to Topic, use the [[<tvar name="1">mw:Special:MyLanguage/Help:What links here</tvar>|backlink]] to go from A to B (disadvantage: not very inviting to create a new content page B; inconvenient if A has many backlinks).</translate>
# <translate><!--T:23--> Insert a red link in Topic to Subtopic as invitation or preparation for creating page Subtopic; use the backlink to go from Subtopic to Topic (disadvantage: not obvious for newbie, much less convenient than automatic redirect, especially if B has many backlinks).</translate>
# <translate><!--T:24--> Both (indirect self-link on Topic). To go from Topic to Subtopic, click the link from Topic to Subtopic, which brings you back to Topic, and use the link in the redirect message (for detecting a redirect see hereinbefore; however, there is no distinction between a redirect back, and an onward redirect) (disadvantage, as far as not yet mentioned: not obvious for newbie).</translate>
# <translate><!--T:25--> Ditto but with a soft redirect from Subtopic to Topic, i.e. a page only containing something like "See [<nowiki/>[Topic]]"; one can see at Topic that Subtopic is very short using the [[<tvar name="1">Special:MyLanguage/Help:Link#Stub feature</tvar>|stub feature]] (disadvantages: a soft redirect is non-standard; people who do not know about its reason may change it in a regular redirect; is a little less convenient than automatic redirect; requires stub feature setting)</translate>
# <translate><!--T:26--> Subtopic is a redirect, link from Topic to Subtopic with "<tvar name="code"><code>redirect=no</code></tvar>" parameter, or link to Subtopic's edit page, e.g. [<tvar name="url">https://meta.wikimedia.org/w/index.php?title=Template&redirect=no</tvar> Template] and [<tvar name="url2">https://meta.wikimedia.org/w/wiki.phtml?title=Template&action=edit</tvar> start page Template], respectively.</translate>


<translate>
As a simple way to avoid problems with infinite [[w:Recursion|recursion]], if the redirect target is another redirect page, the second redirect is not applied.
<!--T:27-->
In the 3rd and 4th cases, especially if Topic has a list of links to pages Subtopic, one can mark the links with more info, e.g. by bolding, and explain the marking.


== See also == <!--T:28-->
When a page called for inclusion is a redirect page, the redirect target is included instead, with the same parameters, without any redirect message. Again, a double redirect does not work.
</translate>
* [[Special:MyLanguage/Help:Link#Stub feature|<translate><!--T:29--> Detecting links to redirects using the stub feature</translate>]]
* {{ll|Don't delete redirects}}
* [[Redirects in search results - proposed software changes|<translate><!--T:30--> Redirects in search results - proposed software changes</translate>]]
* [[Redirected user pages considered harmful|<translate><!--T:31--> Redirected user pages considered harmful</translate>]]
* <translate><!--T:32--> [[w:Wikipedia:Redirect]]</translate>
** [[w:Wikipedia:Redirects for discussion#When_should_we_delete_a_redirect.3F|<translate><!--T:33--> Deletion policy on Wikipedia for redirects</translate>]]
* [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/37LKF4KXSTCTO4ZLHDWY3XDQWSBWBDF4/ <translate><!--T:34--> Double redirect fixer</translate>]
* [[mw:Special:MyLanguage/Manual:Page table|<translate><!--T:35--> Page database table manual for how redirects are stored</translate>]]


[[Category:Redirects{{#translation:}}| ]]
==Purposes of a redirect==

*Finding a page
*Conveniently going to a page
*Conveniently linking indirectly to a page, without the need for a [[Help:Piped link|Piped link]]. For this purpose, making the stem (the common first part) of a collection of strongly related terms a redirect reduces the need for having many redirects. E.g. [[categor]] can be used for category, categories, categorical. Note that having the other redirects anyway is even better; also a piped link is in some respects even better than relying on a redirect, see [[Help:Piped link#Using a redirect as an alternative|Comparison with piped link]].
*Allowing a link title independent of the final link target; one creates a page whose name is the desired link title, and which redirects to the desired target page. See e.g. [[w:Template:Ft]], containing <nowiki>[[30.48 cm|ft]]</nowiki>, with the page [[w:30.48 cm]] redirecting to [[w:Foot (unit of length)]]. The link title "30.48 cm" informs in the hover box about the unit "ft" even without following the link to the article about this unit. See also [[Help:Editing#Hover_box|hover box]] for another technique with a similar result.

Due to redirects, after renamings and merges, old URLs in links, bookmarks, [[w:Search engine|search engine]]s, etc., still lead to the appropriate page.

== The move tool ==

When a page is renamed/moved with the [[Help:Renaming (moving) a page|Renaming (moving) a page]] function, a redirect is automatically created from the old to the new name, and also one for the corresponding talk page.

If the new page name is occupied by a redirect with only one edit in its history, it is replaced by the page being moved. If the redirect has more than one history entry, then it must either be deleted by an administrator or moved to another name. This move will leave behind a new redirect with no edit history, which can then be replaced by the desired page move. It might be desirable to delete the moved redirect.

==Creating a redirect==

If you're creating a new redirect, [[Help:Starting a new page|start a new page]], write <nowiki>#REDIRECT [[pagename]]</nowiki> (or <nowiki>#redirect[[pagename]]</nowiki>) at the top of the page, where ''pagename'' is the name of the target page. Here is [http://meta.wikipedia.org/w/wiki.phtml?title=redirection&action=edit&redirect=no an example]. If you're replacing an existing page with a redirect, for example after merging a duplicate page, go to the page, edit it, and replace the existing text with <nowiki>#REDIRECT [[pagename]]</nowiki>.

Extra text ''after'' the #REDIRECT command and link, ''on the same line'', can serve as explanatory text. It is only shown when viewing the redirect page itself.

Extra ''lines'' of text are [[Help:Automatic conversion of wikitext|automatically deleted]] on Save (not yet on Preview).

The page will not redirect if there is anything on the page ''before'' the redirect. Also, there must be no spaces between the # and the REDIRECT. Consider copying the <nowiki>#REDIRECT [[pagename]]</nowiki> text into the [[Help:Edit summary|edit summary]] so that people know that you have created a redirect.

After you create a redirect, you get sent to a page with the string "&redirects=no" in the URL. Thus the just created redirect page is shown, not the page to which it redirects. To see your redirect working, use your address bar to delete that part of the URL. Alternatively, create a link on another page to your redirect, and then follow that link.

When creating new redirects, bear in mind that creating too many redirects can clutter up the [[Help:Searching|search results page]], which can hinder users. Also, don't spend too much time creating redirects - often it's more important to spend time improving the quality of the target page. A [[Help:Piped link|piped link]] is another way to make a link to a page with a name which does not occur in the first page.

A code like %70 in a redirect disables it, although the link works from the redirect page.

==Changing a redirect==

Click on a link to the redirect page. Then look for the "<code>(redirected from ''[[help:source page demo|source page]]'')</code>" link at the top of the page you've been redirected to. You will be taken to a page looking something like:

<blockquote style="background-color: white; color: black; border:1px solid black; padding: 1em;">
<b><big>Pagename</big></b><br/>
From ''project name'' ...<br/><br/>
<nowiki>#</nowiki>REDIRECT <nowiki>[[''target page'' ]]</nowiki>
</blockquote>

Then click '''Edit this page'''. You can then either change the target of the redirect, or replace the redirect with a brand new page.

Another way to do the same thing: Go to the target page, and click "What links here". This will show you all the back-links from that page, including redirects. To change a redirect, click on it, and then click on '''Edit this page''' as above.

The redirect page shows the canonical form of the target, unlike its preview page, which renders the link in the usual way, compare [http://meta.wikimedia.org/w/index.php?title=Babel&redirect=no] with the preview of [http://meta.wikimedia.org/w/index.php?title=Babel&action=edit].

== Deleting a redirect ==

[[Meta:Administrators|Administrators]] can [[w:Wikipedia:Deletion policy|delete]] redirects in the same way as any other page. There may be project-specific guidelines on when this is appropriate.

== Interwiki redirects and redirects to special pages==

Interwiki redirects and redirects to special pages have been disabled, try e.g. [[Help:Interwiki redirect demo]] and [[Help:Redirect to special page demo]].

Use direct [[Help:Interwiki linking|interwiki link]]s (or direct links to Special pages) without redirect, or a soft redirect (non-automatic): a page with "See ...", e.g. [[w:Wikipedia:Enhanced Recent Changes]].

== A redirect to an anchor ==
An example of this:
<nowiki>#REDIRECT [[definitions#G]]</nowiki>
This is not possible. You will still be redirected to <nowiki>[[definitions]]</nowiki> but you will not be sent to the #G anchor. This feature will probably not be implemented in the future: reportedly it is difficult to implement in a satisfactory way, see [[bugzilla:218]]. (Note: if you view the redirecting article itself, where the redirect appears as a link (definitions#G), the link does work to redirect to the correct anchor.)

== '''<nowiki>*****This seems to work now.*****</nowiki>''' ==

== A redirect to a page in the image or category namespace ==
On Meta and Wikipedia a redirect to an image page or to a category shows the editable text only. To get the full page after being redirected, use the link "Image", or "Category", respectively.

On Commons a redirect to a category gives the full page, but not the subcategories and pages in the redirect page (if that is also a category).

==Images linking to a page==

An image can link to a page of choice instead of the image description page by putting a redirect as "image description". The actual image description then has to be put on the Talk page.

For clarity it may be useful to add a text near the image, which can be made a link to the same page. Thus clicking on the text and on the image has the same effect.

However, when arriving at the target page, not only is the message (Redirected from Image:xxxxx.xxx) displayed, but so is the image itself.

If the main function of the image is just being a symbol for the link, then, before uploading, give it a name describing that function rather than describing the image itself.

See e.g. the two images on [[wikibooks:Main Page:Français]].

See also [[Help:Navigational image]].

==Detecting links to redirects==

Specifying a very high value as threshold in the [[Help:Link#Stub_feature|stub feature]] allows indication of links having a redirect as target: while other links to the main namespace are all marked as stub, they are not (however, links to other namespaces look the same, they are also not marked as stub). This can be useful for clean-up work involving bypassing redirects.

One may want to change the setting only temporarily, if one normally uses the stub feature in the regular way, and/or because section linking does not work on "stubs", unless external link style is used.

==Redirect and/or link to non-existing page==

When B is a subtopic of A, and B does not have its own page, or at least not with additional info, there are the following possibilities:

*redirect B to A, use the backlink to go from A to B (disadvantage: not very inviting to create a new content page B; inconvenient if A has many backlinks)
*link A to B ("[[w:Wikipedia:Red link|red link]]") as invitation or preparation for creating page B; use the backlink to go from B to A (disadvantage: not obvious for newbie, much less convenient than automatic redirect, especially if B has many backlinks)
*both (indirect self-link on A) - after applying the link from A through B back to A, use the link in the redirect message to go from A to B (for detecting a redirect see above; the method is useful for temporary use during clean-up, but not for permanent use; also, there is no distinction between a redirect back, and an onward redirect) (disadvantage, as far as not yet mentioned: not obvious for newbie)
*ditto but with a [[w:Wikipedia:soft redirect|soft redirect]] from B to A, i.e. a page only containing something like "See <nowiki>[[</nowiki>A]]"; one can see at A that B is very short using the [[Help:Link#Stub_feature|stub feature]] (disadvantages: a soft redirect is non-standard; people who do not know about its reason may change it in a regular redirect; is a little less convenient than automatic redirect; requires stub feature setting)
*B is a redirect, link from A to B with "redirect=no", or link to B's edit page, e.g. [http://meta.wikimedia.org/w/index.php?title=Template&redirect=no Template] and [http://meta.wikimedia.org/w/wiki.phtml?title=Template&action=edit start page Template], respectively.

In the 3rd and 4th case, especially if A has a list of links to pages B, one can mark the links with more info, e.g. by bolding, and explain the marking.

==See also==

*[[Help:Link#Stub_feature|Detecting links to redirects using the stub feature]].
*[[m:Redirects in search results - proposed software changes|Redirects in search results - proposed software changes]].
*[[m:Redirected user pages considered harmful|Redirected user pages considered harmful]]
*[[Wikipedia:Redirects_for_deletion#When_should_we_delete_a_redirect.3F|Deletion policy on Wikipedia for redirects]]

{{H:f|langs=|enname=Redirect}}

Revision as of 16:53, 7 February 2024

Redirects have different use cases through Wikimedia wikis.

Local policies

Some projects have policies on what redirects should exist. For example, on the English Wiktionary, most redirects are prohibited by policy.

Broken redirects

On many wikis administrators simply delete them, but it is sometimes useful to keep a broken redirect and wait for the creation of the target, or to set a new target.

Purposes of a redirect

  • Allow access in the case that a page name is provided:
    • which is an alternative name for the subject
    • which is a name for a subtopic (in this case one may use a redirect to a section)
    • which uses alternative capitalization and hyphenation
    • which uses alternative spelling
    • which has a common misspelling
  • Provide a way of conveniently going to a page (shortcut).
  • Keep links to a page active after it has been moved (even if internal links are updated, this still applies for links from outside; also for links in edit summaries).

Special purposes

  • Conveniently linking indirectly to a page, without the need for a piped link. However, a piped link is in some respects even better than relying on a redirect.
  • Allowing a link title independent of the final link target; one creates a page whose name is the desired link title, and which redirects to the desired target page. See e.g. w:Template:Ft, containing [[30.48 cm|ft]], with the page w:30.48 cm redirecting to w:Foot (unit of length). The link title "30.48 cm" informs in the hover box about the unit "ft" even without following the link to the article about this unit. See also Help:Advanced editing for another technique with a similar result.

When creating new redirects, bear in mind that creating too many redirects can clutter up the search results page, which can hinder users. Also, don't spend too much time creating redirects. Often it's more important to spend time improving the quality of the target page. A piped link is another way to make a link to a page with a name which does not occur in the first page.

Using redirects for inexisting but expected pages

When an inexisting page Subtopic could be created as a subtopic of Topic page, there are the following possibilities:

  1. Redirect Subtopic to Topic, use the backlink to go from A to B (disadvantage: not very inviting to create a new content page B; inconvenient if A has many backlinks).
  2. Insert a red link in Topic to Subtopic as invitation or preparation for creating page Subtopic; use the backlink to go from Subtopic to Topic (disadvantage: not obvious for newbie, much less convenient than automatic redirect, especially if B has many backlinks).
  3. Both (indirect self-link on Topic). To go from Topic to Subtopic, click the link from Topic to Subtopic, which brings you back to Topic, and use the link in the redirect message (for detecting a redirect see hereinbefore; however, there is no distinction between a redirect back, and an onward redirect) (disadvantage, as far as not yet mentioned: not obvious for newbie).
  4. Ditto but with a soft redirect from Subtopic to Topic, i.e. a page only containing something like "See [[Topic]]"; one can see at Topic that Subtopic is very short using the stub feature (disadvantages: a soft redirect is non-standard; people who do not know about its reason may change it in a regular redirect; is a little less convenient than automatic redirect; requires stub feature setting)
  5. Subtopic is a redirect, link from Topic to Subtopic with "redirect=no" parameter, or link to Subtopic's edit page, e.g. Template and start page Template, respectively.

In the 3rd and 4th cases, especially if Topic has a list of links to pages Subtopic, one can mark the links with more info, e.g. by bolding, and explain the marking.

See also