Help:Redirects/zh
| Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
|
重定向頁是用來將讀者引導至另一文章。 這功能主要是用於解決多譯名、別名的狀況。
重定向的種類[编辑]
存在兩種重定向:
- Hard redirection: Readers navigated to the redirect page are taken directly to the target page (usually other pages of the same wiki). Only hard redirection is described in this current article.
- Soft redirection: Readers are left on the redirect page but given the option of clicking the link to the target page. Usually this is achieved via a template; see corresponding article on Meta.
建立重定向[编辑]
首先你必須為你想重定向的名字建立一個新頁面(見Help:Starting a new page)。 你也可以編輯一個已存在,但是廢棄的頁面,按上方的「編輯」鈕即可。 不管是哪種狀況,建立重定向的方法都一樣,只需在文章的最前端加上:
#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:
- #REDIRECT[[Help:Magic_words#Page_names]]
- #redirect [[Help:Magic_words#URL_encoded_page_names]]
- #Redirect [[Manual:$wgConf]]
- #REDIRECT [[MediaWiki/fr]] the translated page is imposed
Example of redirection not allowed (not operational):
- #REDIRECT [[{{ll|Help:Magic_words#Page_names}}]] although Special:MyLanguage/Help:Magic words is operational.
請記得使用編輯視窗下面的'顯示預覽'鈕,或是Alt-P,來確定你輸入的頁面名是正確的。
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:
↳ Help:Magic words#URL encoded page names
This is what you must get.
當重定向無效時,預覽文字看起來會像是編號列表項目,目標頁的字是藍色的:(如果您按照這樣保存,它也將是重定向頁面的內容)
1. REDIRECT 页面名称
如果你指定的pagename是尚未建立的,會變成紅字。 在該頁面創立前,你不應該寫重定向頁。
查看重定向[编辑]
把頁面重定向化後,你將無法用該名字或是該名字的連結進入那頁面。 不過,在目標頁的最上方,你可找到一個箭頭標記和該名字的連結, 點進後便可進入重定向頁,该页显示了一个大大的折线箭头符号和重定向的目标。
藉著此法,你可以做任何頁面允許你用的功能。 你可以進入對話頁討論這個重定向、 你可以看該頁面的歷史,包含redirect的紀錄、 如果那重定頁是寫錯的,你可以編輯,並且你也可以將該頁回溯至以前的版本,取消重定向。
刪除重定向[编辑]
通常並沒有刪除重定向頁的需要。 因為他們沒佔據多少資料庫的空間。 如果某件事物名字是很模糊的,放一些相關聯的名字當重定向頁並沒什麼不好,反而有好處。
如果你真的需要刪除重定向(ex.假如該名字具有誹謗性),或是你希望減少人們從該名字切入文章的機會,那麼就照之前的方法進入後,跟著 Help:Deletion and undeletion 步驟做即可。
雙重重定向[编辑]
雙重重定向是指一個指向重定向頁的重定向,並且沒效用。[1] 取而代之的,會顯示下一個重定向頁。 這是個深思熟慮過的規定,一來為了避免無限循环,二來是為了讓事情簡單點。
不過,你可以找出雙重定向並刪除他們,或是改成單獨的重定向。 你可能得經過大量的移動頁面來達成。 使用工具盒的"鏈入頁面"來找出特定頁面的雙重定向,或是用Special:DoubleRedirects來遍历整個wiki找出它們。
$wgFixDoubleRedirects 选项可自动在作业队列中修正双重重定向。 然而,它往往会加剧页面重命名的破坏,因此默认被禁用。 __STATICREDIRECT__魔术字可用于跳过特定页面的双重重定向修正。
重定向到分类名字空间中的页面[编辑]
要重定向到一个分类页并阻止该分类中显示这个重定向,请在“Category”前加个冒号,否则该重定向页也会被归类到该分类。
#REDIRECT [[:Category:Glossary]]
指向分類的重定向[编辑]
拥有移动不留重定向权限的用户可以移动页面并不创建来源页面的重定向。 重定向权限默认被赋予管理员和机器人。
参见[编辑]
- Template:soft redirect — 對於軟重定向。
- Manual:redirect table
- Manual:$wgMaxRedirects — 允许多个连续重定向。
- OutputPage::redirect() — for redirecting to arbitrary URLs from within PHP.
- Category:Redirect extensions
参考资料[编辑]
- ↑ 這可能由$wgMaxRedirects所控制。