A redirect is a way of automatically sending the visitors of one page to another page. For example, people that visit the page Help:Moving a page will be automatically redirected to the page Help:Renaming a page. This page explains the details of how to create redirects and some best practices related to their use.
Contents |
[edit] Creating a Redirect
Each redirect has a source page (the page with the redirect message) and a target page (the page that people are sent to that includes the content). In the following example, our source page will be Source Page and our target page will be Target Page.
To create a redirect, visit the source page (e.g., Source Page) and type in the following code:
#REDIRECT [[Target Page]]
From then on, when people visit or link to the page Source Page, they will be automatically taken to the page Target Page instead.
Notes
- Note that when a source page is followed, the URL of the source page is shown, even though the title and content of the target page is displayed. If you try and edit the page it will edit the target page.
- If the source page already had content on it (which for example has been moved to the new target page), just delete the prior content and replace it with the redirect code shown above.
- After you create a redirect and save it for the first time, you will not automatically be sent to the target page. However, in the future when you visit the source page it will automatically take you to the target page.
- Extra text after the #REDIRECT code is ignored. It only shows up in the preview view. Category tags are an exception (i.e., you can still categorize redirect pages).
- If a target page is itself a redirect source page, then the link will not be followed automatically. This avoids the problem that could occur when two pages both redirect to each other. The page Special:DoubleRedirects shows all such cases. You may want to delete and/or modify the source pages to avoid double redirects.
[edit] The Rename (Move) Tool
When a page is renamed (i.e., "moved"), with the renaming a page tab, a redirect is automatically created from the original page to the newly named page. This makes it so people who visit the old URL will still be taken to the appropriate content. However, if this is not a concern, it is possible to delete the redirect page by following the instructions below: #Deleting a Redirect.
Notes:
- If the new page name is already occupied by a redirect source page with only one edit in its history, it will be replaced by the page being moved. If the redirect source page has more than one history entry, then it must either be deleted by an administrator or renamed. This renaming will leave behind a new redirect with no edit history, which can then be replaced by the desired page.
[edit] Deleting a Redirect
To remove a redirect, you will need to edit the source page and remove the #REDIRECT code. This is not as easy as it may seem, since you will be sent to the target page if you try and visit the source page. To visit the source page without getting redirected, you can visit the Special:Listredirects page, which lists all redircts and their targets. When you click on the source page (the one on the left), it will not send you automatically to the target page. Just edit the source page and remove the #REDIRECT code and the page will no longer send you to the target page.
[edit] Redirect Best Practices
Redirects can be helpful, but if overused can make things more confusing. They are particularly useful when a popular page is renamed. Search engines, individual's bookmarks, and internal wiki links will still lead to the appropriate content if a redirect is used. However, redirects also can clutter up the search results page and the All Pages list, because both the source and target pages are included in them. For this reason, we recommend that redirects be used sparingly, and primarily for situations where a page was renamed.
In many situations, a piped link is a better way of sending someone to a page with a different name than the person might expect. For example, if there is a page titled Acne Vulgaris, instead of creating a redirect page called Acne you could use a piped link to the page as in the following sentence: "People who have [[Acne Vulgaris | acne]] may want to...".
[edit] See Also
- Help:Renaming a page
- WikiProject Redirect Guide on writing good redirects.
- Special:Listredirects - lists all redirects (both source and target pages)
- Special:DoubleRedirects - lists all double redirects
- Special:BrokenRedirects - lists all pages that redirect to a non-existant page
Chronic Pain Wiki