Help:Redirects/zh

重定向頁是用來將讀者引導至另一文章. 這功能主要是用於解決多譯名、別名的狀況.

重定向的種類
存在兩種重定向：

Only hard redirection is described in this current article. Usually this is achieved via a template; see corresponding article on Meta.
 * Hard redirection: Readers navigated to the redirect page are taken directly to the target page (usually other pages of the same wiki).
 * Soft redirection: Readers are left on the redirect page but given the option of clicking the link to the target page.

Appearance
For hard redirects, you immediately get the target page. However, it shows a small notice after the top title to indicate you arrived here indirectly.

 Help:Redirects

建立重定向
When a page is moved, a redirect from the old to the new pagename is automatically created.

拥有 权限的用户可以移动页面并不创建来源页面的重定向. 重定向权限默认被赋予管理员和机器人.

首先你必須為你想重定向的名字建立一個新頁面（見）. 你也可以編輯一個已存在，但是廢棄的頁面，按上方的「編輯」鈕即可. 不管是哪種狀況，建立重定向的方法都一樣，只需在文章的最前端加上：


 * 1) REDIRECT 页面名称

pagename請改成你希望移向的頁面名. 文字「redirect」大小寫不拘，但請注意「 」前面不可有任何空格， 在前面加任何文字將導致語法失效而轉向失敗. 此外，任何在redirect後面的文字都會被忽略不見(並且應該記得刪除)， However, to put or keep the current page name listed in a Category, the usual tag for that category is entered or kept on a line after the redirect code entry.

Redirections can be simple page names or specified using a namespace. They can be suffixed with a section name if you have the corresponding anchor defined on the target page.

Examples of valid operational redirections:


 * #REDIRECTHelp:Magic_words
 * #redirect Help:Magic_words
 * #Redirect Manual:$wgConf
 * #REDIRECT MediaWiki/fr the translated page is imposed

請記得使用編輯視窗下面的'顯示預覽'鈕，或是Alt，來確定你輸入的頁面名是正確的.

When redirection is valid (and operational) you will see in the previewed text the name of the target you have provided, following a 'next line' icon (image) for example as follows: &#x021B3; Help:Magic words#URL encoded page names This is what you must get.

當重定向無效時，預覽文字看起來會像是編號列表項目，目標頁的字是藍色的：（如果您按照這樣保存，它也將是重定向頁面的內容）

1. REDIRECT 页面名称

如果你指定的pagename是尚未建立的，會變成紅字. 在該頁面創立前，你不應該寫重定向頁.

Limitations
A redirect target cannot depend on a variable, template, or parser function. If that is the case, the browser will not be automatically redirected on visiting the page.

Example of redirection not allowed (not operational):
 * #REDIRECT although  is operational.

JavaScript page redirect
In order to avoid JavaScript functionality from breaking, all JavaScript pages have a different redirect syntax from regular pages. This syntax allows for proper execution of the page by the browser's JavaScript engine, as well as being recognised by MediaWiki as a redirect. To create a redirecting JavaScript page, the format that must be used is as follows:

/* #REDIRECT */mw.loader.load( "" );

Where  is the target page name.

查看重定向
把頁面重定向化後，你將無法用該名字或是該名字的連結進入那頁面. 不過，在目標頁的最上方，你可找到一個箭頭標記和該名字的連結， 點進後便可進入重定向頁，该页显示了一个大大的折线箭头符号和重定向的目标. This adds  URL parameter.

 Help:Redirection Help:Redirect

藉著此法，你可以做任何頁面允許你用的功能. 你可以進入對話頁討論這個重定向、 你可以看該頁面的歷史，包含redirect的紀錄、 如果那重定頁是寫錯的，你可以編輯，並且你也可以將該頁回溯至以前的版本，取消重定向.

刪除重定向
通常並沒有刪除重定向頁的需要. 因為他們沒佔據多少資料庫的空間. 如果某件事物名字是很模糊的，放一些相關聯的名字當重定向頁並沒什麼不好，反而有好處.

If want to move a page over a redirect that has only one edit in its history and targeted to the old page name, there is no need to delete the redirect: it is overwritted. If the redirect has more than one history entry, or the redirect target is somewhere else, then it can only be deleted-and-moved by an administrator.

如果你真的需要刪除重定向(ex.假如該名字具有誹謗性)，或是你希望減少人們從該名字切入文章的機會，那麼就照之前的方法進入後，跟著 步驟做即可.

雙重重定向
雙重重定向是指一個指向重定向頁的重定向，並且沒效用. 取而代之的，會顯示下一個重定向頁. 這是個深思熟慮過的規定，一來為了避免無限循环，二來是為了讓事情簡單點.

不過，你可以找出雙重定向並刪除他們，或是改成單獨的重定向. 你可能得經過大量的移動頁面來達成. 使用工具盒的"鏈入頁面"來找出特定頁面的雙重定向，或是用Special:DoubleRedirects來遍历整個wiki找出它們.

选项可自动在作业队列中修正双重重定向. 然而，它往往会加剧页面重命名的破坏，因此默认被禁用. __STATICREDIRECT__ 魔术字可用于跳过特定页面的双重重定向修正.

Broken redirects
If the target page does not exist, the redirect is broken: redirection will not occur. You may find all broken redirects at Special:BrokenRedirects.

重定向到分类名字空间中的页面
要重定向到一个分类页并阻止该分类中显示这个重定向，请在“Category”前加个冒号，否则该重定向页也会被归类到该分类.


 * 1) REDIRECT Category:Glossary

Transcluding a redirect
When a page called for inclusion is a redirect page, the redirect target is included instead, with the same parameters, without any redirect message. A double redirect does not work.

This allows to create several names for the same template.

Links to redirect
An internal link to a redirect page has CSS class . This can be useful to make them stand out, for clean-up work involving bypassing redirects.

参见

 * — 對於軟重定向.
 * — 允许多个连续重定向.
 * — for redirecting to arbitrary URLs from within PHP.
 * — 允许多个连续重定向.
 * — for redirecting to arbitrary URLs from within PHP.