Misplaced Pages

Help:URL: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 22:14, 4 December 2014 view sourceIbadibam (talk | contribs)Extended confirmed users, Rollbackers24,266 editsm URLs of Misplaced Pages pages: list fixes← Previous edit Revision as of 00:26, 9 March 2015 view source PrimeHunter (talk | contribs)Administrators79,229 edits URLs of Misplaced Pages pages: Long page names can be linked with a short URL by using curid=pageidNext edit →
Line 52: Line 52:
* An unofficial redirect site mentioned at ] enables shorter URL's of the form: * An unofficial redirect site mentioned at ] enables shorter URL's of the form:
*:http://enwp.org/Page_name (not controlled by the ], could stop working or change purpose at any time) *:http://enwp.org/Page_name (not controlled by the ], could stop working or change purpose at any time)
* Long page names can be linked with a short URL of the form:
*:<nowiki>http://enwp.org?curid=pageid</nowiki> (pageid has up to 8 digits, shown by clicking "Page information" under "tools" on the left side of the page)


The page name may include a ] prefix (such as "Help:" in this page). With some ] it may also include a parameter, as in http://en.wikipedia.org/Special:Contributions/Jimbo_Wales (but for most special page parameters, see below). The page name may include a ] prefix (such as "Help:" in this page). With some ] it may also include a parameter, as in http://en.wikipedia.org/Special:Contributions/Jimbo_Wales (but for most special page parameters, see below).
Line 61: Line 63:
* To go to the edit page (or view the source of a protected page): http://en.wikipedia.org/search/?title=Train&action=edit. Other parameters can be added, such as ''section=5'' or ''section=new'' to edit or add a page section. There are also parameters for preloading text into the edit box of a new page, as used by the inputbox extension (see ]). * To go to the edit page (or view the source of a protected page): http://en.wikipedia.org/search/?title=Train&action=edit. Other parameters can be added, such as ''section=5'' or ''section=new'' to edit or add a page section. There are also parameters for preloading text into the edit box of a new page, as used by the inputbox extension (see ]).
* To access the ] of a page: http://en.wikipedia.org/search/?title=Train&action=history (or further parameters can be added, as in http://en.wikipedia.org/search/?title=Train&limit=5&offset=90&action=history, which displays edits 91–95). * To access the ] of a page: http://en.wikipedia.org/search/?title=Train&action=history (or further parameters can be added, as in http://en.wikipedia.org/search/?title=Train&limit=5&offset=90&action=history, which displays edits 91–95).
* To link to a particular version of a page: http://en.wikipedia.org/search/?title=Train&oldid=1374279 (where <code>oldid</code> is the revision number), or use ]. A permanent link to the ''present'' version of the page can be accessed by clicking "Permanent link" under "toolbox" on the left side of the page. The version ID is unique across all pages; the title parameter here has no effect, and can be omitted. ] is a wikilink to a page version. * To link to a particular version of a page: http://en.wikipedia.org/search/?title=Train&oldid=1374279 (where <code>oldid</code> is the revision number), or use ]. A permanent link to the ''present'' version of the page can be accessed by clicking "Permanent link" under "tools" on the left side of the page. The version ID is unique across all pages; the title parameter here has no effect, and can be omitted. ] is a wikilink to a page version.
* To link to a ] between two versions of a page: http://en.wikipedia.org/search/?title=Train&diff=1374279&oldid=1260056, where ''diff'' is the ID of the version to appear on the right. Set ''diff=0'' to compare the current version; set ''diff=0'' and ''oldid=0'' to compare the two most recent versions. Again the title parameter has no real effect (you can in fact compare versions of two different pages). ] is a wikilink to a diff (). * To link to a ] between two versions of a page: http://en.wikipedia.org/search/?title=Train&diff=1374279&oldid=1260056, where ''diff'' is the ID of the version to appear on the right. Set ''diff=0'' to compare the current version; set ''diff=0'' and ''oldid=0'' to compare the two most recent versions. Again the title parameter has no real effect (you can in fact compare versions of two different pages). ] is a wikilink to a diff ().
* To ] or unwatch a page: http://en.wikipedia.org/search/?title=Train&action=watch (or ''action=unwatch''). * To ] or unwatch a page: http://en.wikipedia.org/search/?title=Train&action=watch (or ''action=unwatch'').

Revision as of 00:26, 9 March 2015

This page is about various URLs of Misplaced Pages and other Wikimedia servers. For how to markup links, see Help:Link. "WP:URL" redirects here. For the user rights log, see Special:Log/rights. Shortcuts

Like all pages on the World Wide Web, the pages delivered by Wikimedia's servers have URLs to identify them. These are the addresses that appear in your browser's address bar when you view a page. Misplaced Pages editors also have the ability to create hyperlinks to chosen URLs, pointing to pages either within Misplaced Pages and other Wikimedia projects, or elsewhere on the Web.

Linking to URLs

When editing a page, hyperlinks to other pages within Misplaced Pages (or other Wikimedia projects) are normally made as wikilinks or interwikilinks, using the ] syntax described at Help:Link. However if you want to link to an outside website, or to certain specially generated Wikimedia pages (such as a past version of an article), it is necessary to provide the full URL. This is done using external link syntax.

There are three forms of external link syntax:

  • If the URL is simply included in the wikitext, without square brackets, then it appears as written, and a hyperlink is created: http://meta.wikimedia.org/ produces http://meta.wikimedia.org/
  • If the URL is placed in square brackets, then a hyperlink is created with a serial number as its label: gives
  • If the URL is placed in square brackets followed by a space and some text, then that text is used as the label for the hyperlink: gives Wikimedia

Making a link to elsewhere on the same server as the wiki can be simplified by using {{SERVER}}. Example: .

To suppress the external link icon, place the external link between <span class="plainlinks">...</span> tags.

Fixing links with unsupported characters

  • The URL must start with a supported URI scheme. http:// and https:// are always supported. gopher://, irc://, ircs://, ftp://, news://, nntp://, worldwind://, telnet://, svn://, git://, mms:// and mailto: will create a link and an icon but require an agent registered in the browser.
  • URLs containing certain characters will display and link incorrectly unless those characters are percent-encoded. For example, a space must be replaced by %20 (this can be done using the PATH option of the {{urlencode:}} parser function).
This list is incomplete; you can help by adding missing items.
sp " ' , ; < > ? [ ] { | }
%20 %22 %27 %2C %3B %3C %3E %3F %5B %5D %7B %7C %7D
Single apostrophes do not need to be encoded; but unencoded multiples will be parsed as italic or bold markup
  • Titles containing certain characters will display and link incorrectly unless those characters are encoded with HTML character references.
newline [ ] |
space &#91; &#93; &#124;

Dropping http: and https:

If you make an external style link using square brackets from a Wikimedia page to other Wikimedia page, including Misplaced Pages of course, it's better to drop the protocol http: or https:, so that the URL begins with //..., e.g. //en.wikipedia.org/search/?title=Help:URL.

Otherwise, readers are forced to use the specified connection method. If you don't specify the protocol, readers can continue to use the protocol to read that page.

The URL returned by {{SERVER}} magic word begins with //.

  • Example:
  • Result: no protocol (Read this page both with http and https.)
  • Example:
  • Result: no protocol (Read this page both with http and https.)

URLs of Misplaced Pages pages

English Misplaced Pages's URLs begin http://en.wikipedia.org/. That address on its own is redirected to the Main Page.

The page name may include a namespace prefix (such as "Help:" in this page). With some special pages it may also include a parameter, as in http://en.wikipedia.org/Special:Contributions/Jimbo_Wales (but for most special page parameters, see below).

Other URLs associated with a page are constructed by adding a query string. The string can be added to either of the above forms (as in http://en.wikipedia.org/Train?action=history ), but in this case the system defaults to the second form, i.e. it extends the index.php query string "title=Page_name".

Extended URLs are used:

If constructing URLs for Misplaced Pages pages, remember to convert spaces into underscores, and to percent-code special characters where necessary, as described in the previous section. (For how to do this in template code, see Templates and programming below.)

Various kinds of error message may appear if an invalid URL, or one to which you do not have access, is submitted. In other cases the URL may redirect to a valid one (for example, page titles are converted to their canonical form as they are when they appear in wikilinks).

URLs on other Wikimedia projects

Other projects use similar URLs to those of English Misplaced Pages, except that the domain names vary: http://meta.wikimedia.org/ (Meta), http://fr.wikipedia.org/ (French Misplaced Pages), http://de.wiktionary.org/ (German Wiktionary), etc.

Note that http://www.wikipedia.org leads to an international Misplaced Pages portal page, but other URLs beginning with that prefix redirect to English Misplaced Pages.

Other projects may also use different strings in place of "/w/" and "/" in URLs. For details, see the URL help page on Meta.

Templates and programming

For use in templates, correct URLs can be constructed using certain magic words and parser functions such as fullurl, urlencode and others. Details of these can be found at mw:Help:Magic words.

Most programmatic interaction with Misplaced Pages can be performed most efficiently using the API, for which URLs beginning http://en.wikipedia.org/w/api.php are used. For details, see mw:API.

Notes

See also

Misplaced Pages help pages

About Misplaced Pages (?)
Help for readers (?)
Contributing
to Misplaced Pages
 (?)
Getting started (?)
Dos and don'ts (?)
How-to pages and
information pages (?)
Coding (?)
Directories (?)
Missing Manual
Ask for help on your talk page (?)
Category: