Help:URL/pt

PD Nota: Quando modificais esta página, estais a aceitar que a vossa contribuição se publique no marco de CC0. Olhem Páginas de ajuda de domínio público para mais informação.
Algumas revisões antigas desta página foram importadas nos termos da licença CC BY-SA. Só as novas contribuições estão no domínio público.
PD

Para ajuda com os URLs no texto wiki, consulte Ajuda: Hiperligações. Esta página trata sobre vários URLs de páginas de projeto.

URLs nas hiperligações externas

Forma de URL

Uma hiperligação no estilo de hiperligação externa pode ser da forma:

"destino"
https://mediawiki.org/ fica como https://mediawiki.org
[ etiqueta destino ], com um espaço em branco entre eles
[https://mediawiki.org/ wikimedia] fica como wikimedia (consulte também Hiperligações piped)
[ destino ]
"[https://mediawiki.org] e [https://www.w3.org/TR/url/]" fica como " e ". Cada hiperligação exibe um número de série 1, 2, 3, ...

O destino é um URL que começa com https://, https://, ou ftp://. Dentro de parênteses retos, o URL também pode começar com // (sem nenhum esquema), um URL relativo de 'Protocolo' que utiliza o mesmo protocolo (http ou https) como na página da Web atual.

file:// não funciona por predefinição. Se o ativar só funciona no MSIE. Para o ativar, adicione uma entrada $wgUrlProtocols no LocalSettings.php; veja $wgUrlProtocols no DefaultSettings.php para um exemplo.

Carateres permitidos

Todos os carateres do URL devem estar entre:

A-Z a-z 0-9 :._\/~%-+&#?!=()@

If a URL contains a different character you must convert it; for example, ^ has to be written %5e, the hexadecimal ASCII value with a percent sign in front. You can also write a blank space as an underscore.

Conversão de caráter

      "   #   $   %   &   '  (   )   *   ,   ; 
%20 %22 %23 %24 %25 %26 %27 %28 %29 %2a %2c %3b
 <   >   ?   [   ]   ^   `   {   |   }
%3c %3e %3f %5b %5d %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. Exemplo,

 [[m:%C3%80_propos_de_M%C3%A9ta]]

is rendered as m:%C3%80_propos_de_M%C3%A9ta, almost like m:À propos de Méta, which leads to the page on meta.wikimedia.org with in the address bar the URL https://meta.wikimedia.org/wiki/%C3%80_propos_de_M%C3%A9ta

Função do analisador urlencode

  • {{urlencode:"#$%&'()*,;?[]^`{} }}%22%23%24%25%26%27%28%29%2A%2C%3B%3F%5B%5D%5E%60%7B%7D
  • {{urlencode:<}}%3C
  • {{urlencode:>}}%3E
  • {{urlencode:{{!}} }}%7C

There is an external online converter for encoding custom URLs to mediawiki format.

See also (in Wikipedia): Internationalized domain names and Punycode.

Percentagem de codificação

Para carateres ASCII (até decimal 127, hexadecimal 7F) percentagem de codificação significa simplesmente adicionar % ao valor hexadecimal, por exemplo, para um tilde ~ (decimais 126, hexadecimal 7E), é %7E. Otherwise (non-ASCII) convert it first to UTF-8 and then percent-encode it.

Here are the steps to follow with an example:

  1. Convert the character to Unicode, e.g. Latin-1 192 (hex. C0) to À (u+00C0), or windows-1252 131 (hex. 8B) to Š (u+0160).
  2. Convert Unicode to bits, 00000000 11000000 (u+00C0), or 00000001 01100000 (u+0160).
  3. Build groups of six bits from the right adding leading zeros if necessary until the rest are zeros: 000011 000000 (u+00C0), or 000101 100000 (u+0160).
  4. Add 10 in front of all but the leftmost group. 2 bits + 6 bits = 8bits, also known as octet.
  5. If there are only two groups, and the first (left) starts with 0:
    1. Add 11 to the left: 11 000011 10 0000000 (u+00C0), or 11 000101 10 100000 (u+0160).
    2. Convert the octets to hex., add percent in front, ready: %C3%80 (u+00C0), or %C5%A0 (u+0160).
  6. If the first (left) of two groups starts with 1:
    Add 111 00000 10 to the left, then percent-encode three octets, %E0%??%??
  7. If there are three groups, the first (left) starting with 00 (000001 up to 001111):
    Replace 00 by 111 0, percent-encode three octets, ready, result %E?%??%??.
  8. Otherwise it's at least 010000 000000 000000 (u+10000) needing four UTF-8 octets:
    1111 0000 10 010000 10 000000 10 000000 would be %F0%90%80%80.

URLs of pages within the projects

See w:Wikipedia:URLs. On other projects everything works the same, except that the domain names vary:

  • xx.wikipedia.org with xx the language code, see Complete list of language Wikipedias available in Meta-wiki
  • meta.wikimedia.org (meta.wikipedia.org redirects there)
  • xx.wiktionary.org
  • xx.wikiquote.org
  • xx.wikibooks.org
  • xx.wikisource.org
  • sep11.wikipedia.org

A URL starting with www.wikipedia.org redirects to the corresponding one starting with en; only www.wikipedia.org itself leads to a portal page instead of the main page of the English Wikipedia: https://www.wikipedia.org

In projects outside Wikimedia the "w/" in URLs like https://www.wikipedia.org/w/wiki.phtml?title=Main_Page&action=history is sometimes not used, sometimes different, e.g.:

Use in templates

For use in templates, note that all URLs on e.g. the English Wikipedia can be written in the form:

https://en.wikipedia.org/w/index.php?title={{{1}}}

This requires {{{1}}} to be written with underscores and escape codes (if applicable), or can be escaped with urlencode as {{urlencode:{{{1}}}}}.

To benefit from the conversion carried out by magic word fullurl, two parameters are needed: {{fullurl:{{{1}}}|{{{2}}}}}

(see template Url 2p on meta). An example with the second parameter in fullurl fixed is w:Template:ed containing the link [{{fullurl:Template:{{{1}}}|action=edit}} {{MediaWiki:Edit}} {{{2|{{{1}}}}}}].

This works for a link in external link style to a page in the same project. We can use localurl for a link to a project which uses the same string in the URL between the server name and the question mark ($wgScript, on Wikimedia "/w/index.php"), but not for links to other projects.

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.

New pages

Pages are numbered with page_id (see Manual:page table) in order of creation.

Conversely, most Query API output provides page names as well as page ID's, e.g. https://meta.wikimedia.org/w/query.php?titles=Hilfe:Zeitleiste

Page versions get a number "oldid" as soon as they are created; they are produced by variable {{REVISIONID}}. The URL is like in the previous section.

Edit

Examples:

Purge

In some cases of caching problems, to update a page it can help to use action=purge, in a URL like:

{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=purge}}

This results in:

//www.mediawiki.org/w/index.php?title=Help:URL/pt&action=purge

Parameter uselang

In some cases it is helpful to link to another Wikimedia project by using the "&uselang" parameter, in a URL like https://commons.wikimedia.org/w/index.php?title=Glavna_stran&uselang=sl. This allows specifying the language (hereby 'sl' for Slovenian) of the interface messages that will be displayed when opening the page 'Glavna stran' in the Commons project.

Miscellaneous actions

You can fetch the raw wikitext of a page using a URL like

{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=raw}}

which results here in:

//www.mediawiki.org/w/index.php?title=Help:URL/pt&action=raw

Other actions are view, watch, unwatch, delete, revert, rollback, unprotect, info, markpatrolled, validate, render, deletetrackback, and history. (These rarely need to be entered explicitly, as the useful ones are prelinked at various tabs and buttons. Several of these actions require administrator privileges. Other users do not have the link; if they try the URL they get an error.)

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.

See also