Help:Redirect: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
and with underscores for spaces.)
m Reverted changes by 204.108.212.220 (talk) to last version by Mtarch11
(394 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
<languages />
{{hi}} - Other languages: [[w:da:Wikipedia:Hvordan omdirigere jeg en side|da]], [[w:de:Wikipedia:Handbuch - Redirect|de]],
{{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>}}
[[w:ja:Wikipedia:&#12522;&#12480;&#12452;&#12524;&#12463;&#12488;&#12398;&#20351;&#12356;&#26041; |ja]], [[w:pl:Wikipedia:Przekierowanie|pl]], [[w:zh:Wikipedia:%E5%A6%82%E4%BD%95%E9%87%8D%E5%AE%9A%E5%90%91%E4%B8%80%E4%B8%AA%E9%A1%B5%E9%9D%A2 |zh]]


<translate>
''(To go to an interwiki redirect click http://meta.wikimedia.org/w/wiki.phtml?redirect=no&title=X and change the page name (here X) in the address bar of the browser. Type it in canonical form, i.e., starting with a capital, and with underscores for spaces.)''
<!--T:2-->
'''Redirects''' have different use cases through Wikimedia wikis.


== Local policies == <!--T:3-->


<!--T:4-->
For policy on the use and abuse of redirects on the English Wikipedia see [[en:Wikipedia: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-->
See also: [[MeatBall:PageRedirect]], [http://www.disinfopedia.org/wiki.phtml?title=Disinfopedia:How_to_use_redirect_pages Disinfopedia: redirect policy]


<!--T:6-->
== What is a redirect? ==
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-->
A redirect is a page with no other content than something of the form
</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>
<nowiki>#</nowiki>redirect ''link in internal link style''
=== 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>
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.
<!--T:19-->
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.


== Using redirects for inexisting but expected pages == <!--T:20-->
For example, if somebody browses to: http://meta.wikipedia.org/wiki/redirection, or follows a link to [[redirection]], then they will end up at this page instead, and the top of the page will look like:


<!--T:21-->
<blockquote style="background-color: white; color: black; border:1px solid black; padding: 1em;">
When an inexisting page Subtopic could be created as a subtopic of Topic page, there are the following possibilities:
<b><big>Help:Redirect</big></b><br/>
</translate>
(Redirected from [[Redirection]])<br/><br/>
# <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>
''(etc)''
# <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>
</blockquote>
# <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>
If the link is to a non-existing page in the same project, one simply arrives at the redirect page.
<!--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-->
If the link is to a page in another project, going to the redirect results in following the link, regardless of existence (a project does not retrieve information about existence of pages on another project, but just sends through). The browser shows the new URL.
</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 [[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 [[MediaWiki_User%27s_Guide:_Piped_link#Using a redirect as an alternative|Comparison with piped link]].


Due to redirects, after renamings and merges, old URLs in links, bookmarks, [[Wikipedia:en: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.

== How do I create a redirect? ==

If you're creating a new redirect, [[MediaWiki User's Guide: 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 on the page ''after'' the #REDIRECT command and link is 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 [[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 [[MediaWiki User's Guide: Searching for pages|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 [[MediaWiki User's Guide: 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.

== How do I change a redirect? ==

Click on a link to the redirect page. Then look for the "<code>(redirected from [[pagename]])</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/>
# REDIRECT [[target page]]
</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.

These things do not work for redirects to other projects or to Special pages. Use <nowiki>
http://{project domain name}/w/wiki.phtml?title=...&redirect=no </nowiki>
(for projects outside Wikimedia the "w/" is not always used).

Here on Meta, go to http://meta.wikipedia.org/w/wiki.phtml?title=Redirection&redirect=no and change the page name (here Redirection) in the address bar of the browser.

== How do I delete a redirect? ==

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

== Inter-wiki redirects and redirects to Special pages==

It is also possible to set up redirects between MediaWiki wikis, such as between [[Wiktionary]] and [[MeatBall:WikiPedia|Wikipedia]]. Simply append the language code and the page name to the word "Wikipedia" (or other WikiMedia projects: Wikibooks, Wikitext?, Wikiquote?, Wikisource?, ...?) with colons. To link to the Wikipedia article for dog from an article in wiktionary, one would use <nowiki>[[Wikipedia:en:dog]]</nowiki>. For example [[Wikipedia:en:dog]]. As a redirect: <nowiki>#REDIRECT [[Wikipedia:en:dog]]</nowiki>

However, compared with redirects within a MediaWiki wiki there are restrictions and drawbacks:
*The message "Redirected from ..." is not shown.
*Editing the redirect page is cumbersome, one has to use <nowiki>
http://{project domain name}/w/wiki.phtml?title=...&redirect=no </nowiki>
*"What links here" does not work across wiki's; this applies also to redirects, so one can not see which page(s) redirect(s) to a given page.
*Being led to an other wiki without explicit request may be confusing.

In order to change an inter-wiki redirect (perhaps restoring previous content), manually go to a URL like <nowiki>
http://{project domain name}/w/wiki.phtml?title=my_title&redirect=no </nowiki>, but replace "my_title" with the title of the page in question. You can then view page history, edit the page, etc, in the normal fashion. This is tedious, but it is the only way of doing this, currently.

The same applies to redirects to Special pages.

To avoid these problems, consider direct [[interwiki]] links (or direct links to Special pages) without redirect, or a "non-automatic redirect": a page with "See ...", e.g. [[en:Wikipedia:Enhanced Recent Changes]]. This requires an extra click to use, but is less confusing and the redirect page itself is easier to go to (to edit, to apply "What links here" and to discuss it on its Talk page).

If you use a "real" interwiki redirect anyway, put on the page to which the redirect points links to such redirect pages, using a URL with "redirect=no". This is not possible in the case redirect-to-Special.

Alternatively a page like [[en:Wikipedia:What it thinks it is - go to interwiki redirect page itself]] can additionally be made, a redirect page to [[en:Wikipedia:What it thinks it is]] which is an interwiki redirect page; linking to the first-mentioned page leads you to the interwiki redirect page, making use of the fact that redirection is not recursive. Other examples are [[Be bold - go to interwiki redirect page itself]] and the page "Image Go To A Random Page .png ″ go to redirect-to-Special page itself" on Wikibooks: http://wikibooks.org/wiki/Image_Go_To_A_Random_Page_.png_%E2%80%93_go_to_redirect-to-Special_page_itself

There are plans to adjust the software so as to reduce the complications.

== Double redirects ==

As a simple way to avoid problems with infinite [[en:Recursion|recursion]], in the case one is redirected within the same project to another redirect page, the second redirect is not applied.

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

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. two images on the Main Page of http://wikibooks.org/

==See also==

*[[Redirects in search results - proposed software changes]].
*[[Redirected user pages considered harmful]]
*[[Wikipedia:Redirects_for_deletion#When_should_we_delete_a_redirect.3F|Deletion policy on Wikipedia for redirects]]

Next page: [[MediaWiki User's Guide: Interwiki linking| Interwiki linking]] >


[[Category:MediaWiki User's Guide]]

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