Help:Redirect

From K6ka's Wiki
Jump to navigation Jump to search
This page is a help page
It is meant to detail processes or procedures of some aspect or aspects of K6ka's Wiki's norms and practices. It is not a policy page.

A redirect is a method of automatically forwarding readers from one page to another. When a user visits a page that has been designated as a redirect, they will automatically be forwarded to a different page. Redirects are often used when a subject can go by different names, has alternative spellings, or is frequently misspelled.

Creating redirects[edit source]

A page can be designated as a redirect by adding the following wikitext code to the very first line:

#REDIRECT [[Target page name]]

where Target page name is the name of the destination page. For example, #REDIRECT [[France]] would redirect the page to the France article.

It is also possible to create a redirect to a specific section of the destination page. For example, #REDIRECT [[France#History]] would redirect the page to the History section of the France article.

The word #REDIRECT is not case-sensitive, but there may not be a space before the # symbol, or the redirect will not work. Text placed on a separate line after the #REDIRECT code is ignored and will only be displayed when viewing the redirect page directly; this can be used to add categories to redirects. The #REDIRECT code cannot be used with magic words or templates, and they cannot redirect to interwiki or external links.

Viewing redirects[edit source]

Once a page has been redirected, attempting to visit that page will automatically redirect you to the destination page instead. When this happens, a note will appear at the top of the page, just underneath the page title, informing you that you have been redirected, along with a link to the page title that you had initially followed. For example, if the "Transportation" article was redirected to "Transport", attempting to visit the "Transportation" article will redirect you to "Transport", with the following note at the top of the page.

Transport

From K6ka's Wiki

(Redirected from Transportation)

Clicking on "Transportation" will direct you to the redirect page, which appears like this.

Transportation

From K6ka's Wiki

Redirect page

Transport

You can also go directly to the redirect page by adding ?redirect=no to the end of the URL for the redirect page. For example, to get to the "Transportation" redirect page, type k6ka.miraheze.org/wiki/Transportation?redirect=no into the address bar. (If a question mark has already been used in the URL, say for instance, k6ka.miraheze.org/w/index.php?title=Transportation you need to use &redirect=no instead, as follows: k6ka.miraheze.org/w/index.php?title=Transportation&redirect=no.

When viewing a redirect page, you can do all the things you can normally do on regular pages: you can access the redirect's talk page, view its page history, or edit it.

Removing redirects[edit source]

Redirects can be removed by going to the redirect page, editing it, and then removing the #REDIRECT [[Target page name]] code. The page will then become a normal page and will no longer automatically redirect to another page. You can also change the redirect target by changing Target page name to a different name.

Removing a redirect does not delete it, and any other editor can revert the removal of a redirect to restore it. Only administrators can delete a redirect page, which will hide its page history from public view.

Viewing the redirects for a page[edit source]

You can see a list of all redirects that point to a page by going to that page and visiting the What Links Here page for it. Redirects will be shown on the list and be marked as such.

Moving pages[edit source]

Main article: Help:Moving a page

When a page gets moved to a different title, by default a redirect is created at the old title pointing to the new one. This ensures that links pointing to the old title do not break and continue to forward readers to the correct page. Administrators have the option of suppressing the creation of this redirect so that a redirect is not automatically created when they move a page. This option should be used with caution, as it will break any links pointing to the old title.

Non-administrators can move a page over a redirect if the redirect page has only one revision and points to the page that is being moved. For example, if the "Transportation" redirect page has only one edit in its page history and points to the "Transport" page, non-administrators can move the "Transport" page over to the "Transportation" page. This will cause the redirect page to be deleted, thus allowing non-administrators to create entries in the deletion log. This deletion can be reversed by an administrator at any time.

Double redirects[edit source]

A redirect will only be followed once by the software. As such, a redirect page that redirects to another redirect page will not work as intended. When this happens, readers will be redirected to the redirect page, rather than being directed to the final destination. For example, if page ABC redirects to DEF, which redirects to GHI, visiting the page ABC will take you to the redirect page for DEF, rather than to GHI. This is to prevent infinite redirect loops where two or more redirects point to each other. Double redirects usually occur when a page gets moved to a new title, then gets moved to yet another title. The first redirect created in the page move sequence will now point to a redirect page instead of the final destination, and thus be considered a double redirect.

Double redirects must be fixed manually by editing them to point to the final destination page, rather than to another redirect. A list of double redirects can be found at Special:DoubleRedirects.

Broken redirects[edit source]

A broken redirect is a redirect that points to a non-existent page. When this happens, readers will not be redirected and will simply be taken to the redirect page. This usually happens when the target page of the redirect gets deleted.

Broken redirects can be fixed either by changing them to point to a page that does exist, or simply deleted by an administrator. A list of broken redirects can be found at Special:BrokenRedirects.

Template redirects[edit source]

Template pages can be redirected like any other page. When the template is transcluded onto another page, the redirect will be followed and the contents of the target page will be transcluded instead. For example, if [[Template:ABC]] was redirected to [[Template:XYZ]], typing {{XYZ}} will have the same effect as typing {{ABC}}.

Category and file redirects[edit source]

See also: Help:Category#Redirecting category pages

Category and file pages can be redirected as well. The link needs to be prefixed with a colon in order for the link to work properly. Otherwise, the page will be categorized into the category or the file will be displayed on the page, rather than being properly redirected.

#REDIRECT [[:Category:XYZ]] (for categories)

#REDIRECT [[:File:XYZ.jpg]] (for files)

Soft redirects[edit source]

A soft redirect is a redirect that does not automatically redirect to its target destination, but instead presents the reader with a link pointing to the intended destination. The reader will need to click on the link in order to continue. This is usually done to redirect pages to a different wiki, or to a page that normally cannot be redirected to (such as special pages).

Soft redirects are not a part of the MediaWiki software that powers K6ka's Wiki, but rather is accomplished by using the {{Soft redirect}} template. In these cases, the page is treated like a normal page by the software, not as a redirect page, and thus will not appear in maintenance pages such as Special:DoubleRedirects or Special:BrokenRedirects.

See also[edit source]