Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

Project:站外連結轉向

本文件正在翻譯中,請協助翻譯。

原文 / 參考

MDC wiki 可以直接讓某頁面重新導向至站外的資源,因此那些外部資源可以藉此一並列在 Wiki 的分類頁面中。

建立導向外部資源

To create one of these external redirects, do the following:

首先,建立一個用以導向至外部資源的頁面,並在其標題後方加上「(外連)」這樣的字串,就像 en:Mozilla Project Wiki (external) 一樣。這個「(外連)」,可以協助使用者確定自己是否即將前往外部網站。建立外連頁面主要是為了分類頁這類無法自行編輯連結的頁面,請參考後面關於建立手動連結到外連頁面的方法。

Next, edit that page and add the redirect command, followed by the desired target URL enclosed in double square brackets. For example:

 #RE‌DIRECT [[http://wiki.mozilla.org]]

Finally, add a category to the redirect page. Note that the category must be on the same line as the REDIRECT command, or the parser will ignore it. For example:

 #RE‌DIRECT [[http://wiki.mozilla.org]] [[Category:Mozilla Project:Other Resources]]

When this is finished, simply save the page as normal.

Manually linking to external redirects

You should not create links to external redirects. Instead, just create regular external links to the site. The reason for this is because linking to an external redirect obscures the URL and users won't know where they will end up. This can be pretty annoying, and annoying users is a bad thing.

Editing External Redirects

Since an external redirect page immediately bounces you to the external site, editing the external redirect can be a challenge. To do so, simply add "?action=edit" to the end of the URL for the external redirect page. This is somewhat inconvenient, but it works. For example:

Example

Migrating pages referred to by external redirects

If you migrate an article into the MDC check the category page to see if there's an external redirect pointing at it as well.

If there is, check the "what links here" (link in right column, in Toolbox) to see if any other pages link to that external redirect. If any links exist, change them so they point at the newly migrated article.

When no pages link to the external redirect page, redirect it to the newly migrated article and put it in the "Junk" category (using [[Category:Junk]]) so it can be deleted.

If you have any questions about using External Redirects, feel free to email Deb Richardson at mailto:deb@dria.org.

文件標籤與貢獻者

標籤: 
 此頁面的貢獻者: irvinfly, fscholz, BobChao
 最近更新: irvinfly,