Help:URL
URLs in external links
A link in external link style can be of the forms:
- target: http://meta.wikimedia.org/ is rendered as http://meta.wikimedia.org/
- [ target label ], with a blank space in between: [http://meta.wikimedia.org/ wikimedia] gives wikimedia (see also Help:Piped link)
- [ target ] - these are automatically labelled with serial numbers 1, 2, 3, ...: [http://meta.wikimedia.org/] gives [1]
The target is a URL which can start with "http://" or "ftp://";
"file://" does not work by default. If enabled it only works in MSIE. To enable it, add a $wgUrlProtocols entry to LocalSettings.php; see the $wgUrlProtocols in DefaultSettings.php for example.
All characters of the URL must be among:
A-Z a-z 0-9 ._\/~%-+&#?!=()@
If a URL contains a different character it should be converted; for example, ^ has to be written %5e, the hexadecimal ASCII value with a percent sign in front. A blank space can also be converted into an underscore.
Conversion:
" # $ % & ' * , : ; < > ? [ ^ ` { | } %22 %23 %24 %25 %26 %27 %2a %2c %3a %3b %3c %3e %3f %5b %5e %60 %7b %7c %7d
For the other characters either the code or the character can be used in internal and external links, they are equivalent. The system does a conversion when needed. E.g.
[[%C3%80_propos_de_M%C3%A9ta]]
is rendered as À_propos_de_Méta, almost like À propos de Méta, which leads to this page on Meta with in the address bar the URL
http://meta.BelieveTheSign.org/wiki/%C3%80_propos_de_M%C3%A9ta
while http://meta.BelieveTheSign.org/wiki/À_propos_de_Méta leads to the same.
See also (in BelieveTheSign): Internationalized domain names and Punycode.
Use in templates
For use in templates, note that all URLs on e.g. BelieveTheSign can be written in the form
http://www.BelieveTheSign.org/w/index.php?title={{{1}}}
This requires {{{1}}} to be written with underscores and escape codes (if applicable). To benefit from the conversion carried out by localurl, two parameters are needed:
http://en.BelieveTheSign.org{{localurl:{{{1}}}|{{{2}}}}}
(see Template talk:Url 2p). An example with the second parameter in localurl fixed is Template:Tcw.
Old versions of pages
All old versions of all pages are numbered (with oldid) approximately in the order of becoming an old version, i.e. in chronological order of the next edit of the same page.
- http://meta.wikimedia.org/w/wiki.phtml?title=Help:Link&oldid=53587 - normal link to old page
- http://meta.wikimedia.org/w/wiki.phtml?oldid=53587 - no page name in the URL, goes to the correct page
- http://meta.wikimedia.org/w/wiki.phtml?title=Help:Link&oldid=53588 - number and name do not correspond; the name is ignored
- http://meta.wikimedia.org/w/wiki.phtml?title=abc&oldid=53587 - non-existing page name; oldid is ignored, works like going to a non-existing page, except for the links to assumed previous and next versions, and on editing, for the warning of editing an old version of a page.
See also Linking to specific versions of articles.
New pages
New pages are numbered (with curid) chronologically.
- http://meta.wikimedia.org/w/wiki.phtml?title=x&curid=9906 - gives the page with correct full name
See also Multiple titles.
Edit
Examples:
- Edit the whole page: http://meta.wikimedia.org/w/wiki.phtml?title=Help:URL&action=edit
- Edit the 5th section: http://meta.wikimedia.org/w/wiki.phtml?title=Help:URL&action=edit§ion=5
- Add at the end: http://meta.wikimedia.org/w/wiki.phtml?title=Help:URL&action=edit§ion=1000 (use large section number)
- Ditto with "Post a comment" feature: http://meta.wikimedia.org/w/wiki.phtml?title=Help:URL&action=edit§ion=new
Purge
In some cases of caching problems, to update a page it can help to use "action=purge", in a URL like https://en.believethesign.com/index.php?title=Help:URL&action=purge
Kinds of dead links
There can be various kinds of errors in the URL. With some the server is not even reached, with others the server takes some action. The server may also go to the correct page and just ignore a wrong parameter or anchor.
- https://en.believethesign.com{{localurl:%abc}}
- http://meta.wikimedia.or/
- https://en.believethesign.comabc
- http://met.mediawiki.org
- https://en.believethesign.com/abc
- http://meta.wikimedia.org/w/index.php?title=Help:URL&action=abc
- http://meta.wikimedia.org/w/index.php?title=Help:URL&act=abc
- http://meta.wikimedia.org/w/index.php?title=Help:URL#abc