Help:Redirect: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
mNo edit summary
m Reverted changes by 204.108.212.220 (talk) to last version by Mtarch11
(452 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
<languages />
Other languages: [[DaWikipedia:Wikipedia:Hvordan omdirigere jeg en side|da]], [[DeWikipedia: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>}}
[[JaWikipedia:Wikipedia:&#12522;&#12480;&#12452;&#12524;&#12463;&#12488;&#12398;&#20351;&#12356;&#26041; |ja]],
[[PlWikipedia:Wikipedia:Przekierowanie|pl]], [[ZhWikipedia: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>
<-[[MediaWiki User's Guide]]
<!--T:2-->
'''Redirects''' have different use cases through Wikimedia wikis.


== Local policies == <!--T:3-->
== What is a redirect? ==


<!--T:4-->
[[MediaWiki]] uses redirects to direct people who go to one location on a MediaWiki wiki to another. 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:
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-->
<blockquote style="background-color: white; color: black; border:1px solid black; padding: 1em;">
<b><big>MediaWiki:Redirect</big></b><br>
(Redirected from [[Redirection]])<br><br>
''(etc)''
</blockquote>


<!--T:6-->
This tutorial discusses '''redirects''' as used in MediaWiki. It will cover the following topics:
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-->
== Renamings and merges ==
</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>
Broken links are generally considered to be bad, because they annoy visitors. [[EnWikipedia:Search engine|Search engine]]s and visitors will probably have linked to ''that'' page at ''that'' url. If the page is deleted, potential new visitors from search engines will be greeted with an edit window. The same is true for anyone who previously bookmarked ''that'' page, and so on.
=== 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>
On a small scale, this applies to cases where duplicate pages exist on some subject, or lots of twisty little stubs on different aspects of the same overall subject.
<!--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-->
== The move tool ==


<!--T:21-->
When a page is moved/renamed with the the [[MediaWiki User's Guide: Renaming (moving) pages|Move page]] function, a redirect is automatically created from the old to the new name.
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>
== How do I create a redirect? ==
<!--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 you're creating a new redirect, [[MediaWiki User's Guide: Starting a new page|start a new page]], write <nowiki>#REDIRECT [[pagename]]</nowiki> at the top of the page, where ''pagename'' is the name of the target page. Here is [http://www.MediaWiki.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>.
</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:}}| ]]
A redirect page will still redirect if there is extra text on the page ''after'' the #REDIRECT command and link (but this text will normally not be seen). However, it 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 [[MediaWiki User's Guide: 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 page that links 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. Use <nowiki>
http://{project name}.org/w/wiki.phtml?title=...&redirect=no </nowiki>

== How do I delete a redirect? ==

To delete a redirect without replacing it with a new page, list it on your project's "votes for deletion" page. See your project's deletion policy page for details on how to nominate pages for deletion.

You might want to delete a redirect if one or more of the following conditions is met:
# The redirect page makes it ''unreasonably'' difficult for users to locate similarly named pages via the search engine. (see [[meta:searches and redirects]] for proposals to lessen this impact)
# The redirect might cause confusion.
# The redirect is offensive.
# The redirect makes no sense, such as [[Pink elephants painting daisies]] to [[Chemistry]]

However, avoid deleting such redirects if:
# They have a potentially useful page history. If the redirect was created by renaming a page with that name, and the page history just mentions the renaming, and for one of the reasons above you want to delete the page, copy the page history to the Talk page of the page it redirects to. The act of renaming is useful page history, and even more so if there has been discussion on the page name.
# They would aid accidental linking and make the creation of duplicate pages less likely
# They aid searches on certain terms.
# Someone finds them useful. Hint: If someone says they find a redirect useful, they probably do. You might not find it useful - this is not because the other person is a liar, but because you browse MediaWiki in different ways.

== What needs to be done on pages that are targets of redirects? ==

We follow the "[[EnWikipedia:principle of least astonishment|principle of least astonishment]]" - after following a redirect, the readers's first question is likely to be: "hang on ... I wanted to read about ''this''. Why has the link taken me to ''that''?". Make it clear to the reader that they ''have'' arrived in the right place.

Normally, we try to make sure that all "inbound redirects" are mentioned in the first couple of paragraphs of the page.

== Self-links, duplicate links ==

Avoid self-links, including self-links through redirects ("loop links"). Also, avoid having two links that go to the same place. These can confuse readers, and cause them to unnecessarilly load the same page twice.

== Inter-wiki redirects ==

It is also possible to set up redirects between MediaWiki wikis, such as [[EnWikipedia:Wikipedia|Wikipedia]]. Simply proceed the page name with the wiki name and a colon. To link to the Wikipedia article for dog, one would use <nowiki>[[EnWikipedia:dog]]</nowiki>. For example [[EnWikipedia:dog]]. As a redirect: <nowiki>#REDIRECT[[EnWikipedia: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 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 name}.org/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.

== Double redirects ==

As a simple way to avoid problems with [[EnWikipedia:infinite recursion|infinite recursion]], you cannot have a redirect to a redirect to a page. In such a case, only the first redirect is followed.

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