]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" (C) Copyright 1999-2000 David A. Wheeler (dwheeler@dwheeler.com) |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
4 | .\" |
5 | .\" Fragments of this document are directly derived from IETF standards. | |
6 | .\" For those fragments which are directly derived from such standards, | |
7 | .\" the following notice applies, which is the standard copyright and | |
8 | .\" rights announcement of The Internet Society: | |
9 | .\" | |
10 | .\" Copyright (C) The Internet Society (1998). All Rights Reserved. | |
11 | .\" This document and translations of it may be copied and furnished to | |
12 | .\" others, and derivative works that comment on or otherwise explain it | |
13 | .\" or assist in its implementation may be prepared, copied, published | |
14 | .\" and distributed, in whole or in part, without restriction of any | |
15 | .\" kind, provided that the above copyright notice and this paragraph are | |
16 | .\" included on all such copies and derivative works. However, this | |
17 | .\" document itself may not be modified in any way, such as by removing | |
18 | .\" the copyright notice or references to the Internet Society or other | |
19 | .\" Internet organizations, except as needed for the purpose of | |
20 | .\" developing Internet standards in which case the procedures for | |
21 | .\" copyrights defined in the Internet Standards process must be | |
22 | .\" followed, or as required to translate it into languages other than English. | |
23 | .\" | |
24 | .\" Modified Fri Jul 25 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) | |
25 | .\" Modified Fri Aug 21 23:00:00 1999 by David A. Wheeler (dwheeler@dwheeler.com) | |
26 | .\" Modified Tue Mar 14 2000 by David A. Wheeler (dwheeler@dwheeler.com) | |
27 | .\" | |
4c1c5274 | 28 | .TH uri 7 (date) "Linux man-pages (unreleased)" |
fea681da MK |
29 | .SH NAME |
30 | uri, url, urn \- uniform resource identifier (URI), including a URL or URN | |
31 | .SH SYNOPSIS | |
32 | .nf | |
33 | .HP 0.2i | |
34 | URI = [ absoluteURI | relativeURI ] [ "#" fragment ] | |
35 | .HP | |
36 | absoluteURI = scheme ":" ( hierarchical_part | opaque_part ) | |
37 | .HP | |
38 | relativeURI = ( net_path | absolute_path | relative_path ) [ "?" query ] | |
fea681da | 39 | .HP |
c79efe90 MK |
40 | scheme = "http" | "ftp" | "gopher" | "mailto" | "news" | "telnet" | |
41 | "file" | "man" | "info" | "whatis" | "ldap" | "wais" | \&... | |
fea681da MK |
42 | .HP |
43 | hierarchical_part = ( net_path | absolute_path ) [ "?" query ] | |
fea681da MK |
44 | .HP |
45 | net_path = "//" authority [ absolute_path ] | |
46 | .HP | |
47 | absolute_path = "/" path_segments | |
48 | .HP | |
49 | relative_path = relative_segment [ absolute_path ] | |
50 | .fi | |
51 | .SH DESCRIPTION | |
fea681da MK |
52 | A Uniform Resource Identifier (URI) is a short string of characters |
53 | identifying an abstract or physical resource (for example, a web page). | |
1ae6452e AC |
54 | A Uniform Resource Locator (URL) is a URI |
55 | that identifies a resource through its primary access | |
56 | mechanism (e.g., its network "location"), rather than | |
57 | by name or some other attribute of that resource. | |
58 | A Uniform Resource Name (URN) is a URI | |
59 | that must remain globally unique and persistent even when | |
60 | the resource ceases to exist or becomes unavailable. | |
fea681da MK |
61 | .PP |
62 | URIs are the standard way to name hypertext link destinations | |
63 | for tools such as web browsers. | |
1ae6452e AC |
64 | The string "http://www.kernel.org" is a URL (and thus it |
65 | is also a URI). | |
66 | Many people use the term URL loosely as a synonym for URI | |
67 | (though technically URLs are a subset of URIs). | |
fea681da MK |
68 | .PP |
69 | URIs can be absolute or relative. | |
70 | An absolute identifier refers to a resource independent of | |
71 | context, while a relative | |
72 | identifier refers to a resource by describing the difference | |
73 | from the current context. | |
74 | Within a relative path reference, the complete path segments "." and | |
75 | ".." have special meanings: "the current hierarchy level" and "the | |
76 | level above this hierarchy level", respectively, just like they do in | |
008f1ecc | 77 | UNIX-like systems. |
fea681da MK |
78 | A path segment which contains a colon |
79 | character can't be used as the first segment of a relative URI path | |
80 | (e.g., "this:that"), because it would be mistaken for a scheme name; | |
81 | precede such segments with ./ (e.g., "./this:that"). | |
b9560046 | 82 | Note that descendants of MS-DOS (e.g., Microsoft Windows) replace |
fea681da MK |
83 | devicename colons with the vertical bar ("|") in URIs, so "C:" becomes "C|". |
84 | .PP | |
85 | A fragment identifier, if included, refers to a particular named portion | |
f81fb444 MK |
86 | (fragment) of a resource; text after a \(aq#\(aq identifies the fragment. |
87 | A URI beginning with \(aq#\(aq refers to that fragment in the current resource. | |
446a4bc8 | 88 | .SS Usage |
fea681da MK |
89 | There are many different URI schemes, each with specific |
90 | additional rules and meanings, but they are intentionally made to be | |
91 | as similar as possible. | |
1ae6452e | 92 | For example, many URL schemes |
fea681da MK |
93 | permit the authority to be the following format, called here an |
94 | .I ip_server | |
95 | (square brackets show what's optional): | |
96 | .HP | |
97 | .IR "ip_server = " [ user " [ : " password " ] @ ] " host " [ : " port ] | |
98 | .PP | |
18701562 | 99 | This format allows you to optionally insert a username, |
fea681da MK |
100 | a user plus password, and/or a port number. |
101 | The | |
102 | .I host | |
103 | is the name of the host computer, either its name as determined by DNS | |
104 | or an IP address (numbers separated by periods). | |
105 | Thus the URI | |
ffc3e08c JW |
106 | <http://fred:fredpassword@example.com:8080/> |
107 | logs into a web server on host example.com | |
fea681da MK |
108 | as fred (using fredpassword) using port 8080. |
109 | Avoid including a password in a URI if possible because of the many | |
110 | security risks of having a password written down. | |
1ae6452e AC |
111 | If the URL supplies a username but no password, and the remote |
112 | server requests a password, the program interpreting the URL | |
fea681da MK |
113 | should request one from the user. |
114 | .PP | |
008f1ecc | 115 | Here are some of the most common schemes in use on UNIX-like systems |
fea681da MK |
116 | that are understood by many tools. |
117 | Note that many tools using URIs also have internal schemes or specialized | |
118 | schemes; see those tools' documentation for information on those schemes. | |
446a4bc8 MK |
119 | .PP |
120 | .B "http \- Web (HTTP) server" | |
121 | .PP | |
fea681da MK |
122 | .RI http:// ip_server / path |
123 | .br | |
124 | .RI http:// ip_server / path ? query | |
125 | .PP | |
1ae6452e | 126 | This is a URL accessing a web (HTTP) server. |
fea681da MK |
127 | The default port is 80. |
128 | If the path refers to a directory, the web server will choose what | |
129 | to return; usually if there is a file named "index.html" or "index.htm" | |
130 | its content is returned, otherwise, a list of the files in the current | |
131 | directory (with appropriate links) is generated and returned. | |
132 | An example is <http://lwn.net>. | |
133 | .PP | |
134 | A query can be given in the archaic "isindex" format, consisting of a | |
135 | word or phrase and not including an equal sign (=). | |
136 | A query can also be in the longer "GET" format, which has one or more | |
137 | query entries of the form | |
138 | .IR key = value | |
139 | separated by the ampersand character (&). | |
140 | Note that | |
141 | .I key | |
142 | can be repeated more than once, though it's up to the web server | |
143 | and its application programs to determine if there's any meaning to that. | |
144 | There is an unfortunate interaction with HTML/XML/SGML and | |
145 | the GET query format; when such URIs with more than one key | |
146 | are embedded in SGML/XML documents (including HTML), the ampersand | |
147 | (&) has to be rewritten as &. | |
148 | Note that not all queries use this format; larger forms | |
149 | may be too long to store as a URI, so they use a different | |
6116ff44 MK |
150 | interaction mechanism (called POST) which does |
151 | not include the data in the URI. | |
fea681da | 152 | See the Common Gateway Interface specification at |
608bf950 SK |
153 | .UR http://www.w3.org\:/CGI |
154 | .UE | |
155 | for more information. | |
446a4bc8 MK |
156 | .PP |
157 | .B "ftp \- File Transfer Protocol (FTP)" | |
158 | .PP | |
fea681da MK |
159 | .RI ftp:// ip_server / path |
160 | .PP | |
1ae6452e | 161 | This is a URL accessing a file through the file transfer protocol (FTP). |
fea681da | 162 | The default port (for control) is 21. |
18701562 | 163 | If no username is included, the username "anonymous" is supplied, and |
fea681da MK |
164 | in that case many clients provide as the password the requestor's |
165 | Internet email address. | |
166 | An example is | |
167 | <ftp://ftp.is.co.za/rfc/rfc1808.txt>. | |
446a4bc8 MK |
168 | .PP |
169 | .B "gopher \- Gopher server" | |
170 | .PP | |
fea681da MK |
171 | .RI gopher:// ip_server / "gophertype selector" |
172 | .br | |
173 | .RI gopher:// ip_server / "gophertype selector" %09 search | |
174 | .br | |
175 | .RI gopher:// ip_server / "gophertype selector" %09 search %09 gopher+_string | |
176 | .br | |
177 | .PP | |
178 | The default gopher port is 70. | |
179 | .I gophertype | |
180 | is a single-character field to denote the | |
181 | Gopher type of the resource to | |
1ae6452e | 182 | which the URL refers. |
fea681da MK |
183 | The entire path may also be empty, in |
184 | which case the delimiting "/" is also optional and the gophertype | |
185 | defaults to "1". | |
186 | .PP | |
187 | .I selector | |
c13182ef MK |
188 | is the Gopher selector string. |
189 | In the Gopher protocol, | |
fea681da MK |
190 | Gopher selector strings are a sequence of octets which may contain |
191 | any octets except 09 hexadecimal (US-ASCII HT or tab), 0A hexadecimal | |
192 | (US-ASCII character LF), and 0D (US-ASCII character CR). | |
446a4bc8 MK |
193 | .PP |
194 | .B "mailto \- Email address" | |
195 | .PP | |
fea681da MK |
196 | .RI mailto: email-address |
197 | .PP | |
198 | This is an email address, usually of the form | |
199 | .IR name @ hostname . | |
200 | See | |
201 | .BR mailaddr (7) | |
202 | for more information on the correct format of an email address. | |
203 | Note that any % character must be rewritten as %25. | |
204 | An example is <mailto:dwheeler@dwheeler.com>. | |
446a4bc8 MK |
205 | .PP |
206 | .B "news \- Newsgroup or News message" | |
207 | .PP | |
fea681da MK |
208 | .RI news: newsgroup-name |
209 | .br | |
210 | .RI news: message-id | |
211 | .PP | |
212 | A | |
213 | .I newsgroup-name | |
214 | is a period-delimited hierarchical name, such as | |
215 | "comp.infosystems.www.misc". | |
216 | If <newsgroup-name> is "*" (as in <news:*>), it is used to refer | |
217 | to "all available news groups". | |
218 | An example is <news:comp.lang.ada>. | |
219 | .PP | |
220 | A | |
221 | .I message-id | |
222 | corresponds to the Message-ID of | |
608bf950 | 223 | .UR http://www.ietf.org\:/rfc\:/rfc1036.txt |
331da7c3 | 224 | IETF RFC\ 1036, |
fea681da MK |
225 | .UE |
226 | without the enclosing "<" | |
227 | and ">"; it takes the form | |
228 | .IR unique @ full_domain_name . | |
229 | A message identifier may be distinguished from a news group name by the | |
230 | presence of the "@" character. | |
446a4bc8 MK |
231 | .PP |
232 | .B "telnet \- Telnet login" | |
233 | .PP | |
fea681da MK |
234 | .RI telnet:// ip_server / |
235 | .PP | |
1ae6452e | 236 | The Telnet URL scheme is used to designate interactive text services that |
c13182ef MK |
237 | may be accessed by the Telnet protocol. |
238 | The final "/" character may be omitted. | |
fea681da MK |
239 | The default port is 23. |
240 | An example is <telnet://melvyl.ucop.edu/>. | |
446a4bc8 MK |
241 | .PP |
242 | .B "file \- Normal file" | |
243 | .PP | |
fea681da MK |
244 | .RI file:// ip_server / path_segments |
245 | .br | |
246 | .RI file: path_segments | |
247 | .PP | |
248 | This represents a file or directory accessible locally. | |
249 | As a special case, | |
7adfc6e1 | 250 | .I ip_server |
fea681da | 251 | can be the string "localhost" or the empty |
1ae6452e | 252 | string; this is interpreted as "the machine from which the URL is |
2d986c92 | 253 | being interpreted". |
fea681da MK |
254 | If the path is to a directory, the viewer should display the |
255 | directory's contents with links to each containee; | |
256 | not all viewers currently do this. | |
1ae6452e | 257 | KDE supports generated files through the URL <file:/cgi-bin>. |
fea681da MK |
258 | If the given file isn't found, browser writers may want to try to expand |
259 | the filename via filename globbing | |
260 | (see | |
261 | .BR glob (7) | |
262 | and | |
263 | .BR glob (3)). | |
264 | .PP | |
265 | The second format (e.g., <file:/etc/passwd>) | |
266 | is a correct format for referring to | |
c13182ef MK |
267 | a local file. |
268 | However, older standards did not permit this format, | |
fea681da | 269 | and some programs don't recognize this as a URI. |
75b94dc3 MK |
270 | A more portable syntax is to use an empty string as the server name, |
271 | for example, | |
fea681da MK |
272 | <file:///etc/passwd>; this form does the same thing |
273 | and is easily recognized by pattern matchers and older programs as a URI. | |
c75cdeb4 | 274 | Note that if you really mean to say "start from the current location", don't |
fea681da MK |
275 | specify the scheme at all; use a relative address like <../test.txt>, |
276 | which has the side-effect of being scheme-independent. | |
277 | An example of this scheme is <file:///etc/passwd>. | |
446a4bc8 MK |
278 | .PP |
279 | .B "man \- Man page documentation" | |
280 | .PP | |
fea681da MK |
281 | .RI man: command-name |
282 | .br | |
283 | .RI man: command-name ( section ) | |
284 | .PP | |
285 | This refers to local online manual (man) reference pages. | |
6116ff44 MK |
286 | The command name can optionally be followed by a |
287 | parenthesis and section number; see | |
fea681da MK |
288 | .BR man (7) |
289 | for more information on the meaning of the section numbers. | |
008f1ecc | 290 | This URI scheme is unique to UNIX-like systems (such as Linux) |
fea681da MK |
291 | and is not currently registered by the IETF. |
292 | An example is <man:ls(1)>. | |
446a4bc8 MK |
293 | .PP |
294 | .B "info \- Info page documentation" | |
295 | .PP | |
fea681da MK |
296 | .RI info: virtual-filename |
297 | .br | |
298 | .RI info: virtual-filename # nodename | |
299 | .br | |
300 | .RI info:( virtual-filename ) | |
301 | .br | |
302 | .RI info:( virtual-filename ) nodename | |
303 | .PP | |
304 | This scheme refers to online info reference pages (generated from | |
6116ff44 MK |
305 | texinfo files), |
306 | a documentation format used by programs such as the GNU tools. | |
008f1ecc | 307 | This URI scheme is unique to UNIX-like systems (such as Linux) |
fea681da MK |
308 | and is not currently registered by the IETF. |
309 | As of this writing, GNOME and KDE differ in their URI syntax | |
310 | and do not accept the other's syntax. | |
311 | The first two formats are the GNOME format; in nodenames all spaces | |
312 | are written as underscores. | |
313 | The second two formats are the KDE format; | |
314 | spaces in nodenames must be written as spaces, even though this | |
315 | is forbidden by the URI standards. | |
316 | It's hoped that in the future most tools will understand all of these | |
317 | formats and will always accept underscores for spaces in nodenames. | |
318 | In both GNOME and KDE, if the form without the nodename is used the | |
319 | nodename is assumed to be "Top". | |
320 | Examples of the GNOME format are <info:gcc> and <info:gcc#G++_and_GCC>. | |
321 | Examples of the KDE format are <info:(gcc)> and <info:(gcc)G++ and GCC>. | |
446a4bc8 MK |
322 | .PP |
323 | .B "whatis \- Documentation search" | |
324 | .PP | |
fea681da MK |
325 | .RI whatis: string |
326 | .PP | |
6116ff44 MK |
327 | This scheme searches the database of short (one-line) descriptions of |
328 | commands and returns a list of descriptions containing that string. | |
fea681da MK |
329 | Only complete word matches are returned. |
330 | See | |
331 | .BR whatis (1). | |
008f1ecc | 332 | This URI scheme is unique to UNIX-like systems (such as Linux) |
fea681da | 333 | and is not currently registered by the IETF. |
446a4bc8 MK |
334 | .PP |
335 | .B "ghelp \- GNOME help documentation" | |
336 | .PP | |
fea681da MK |
337 | .RI ghelp: name-of-application |
338 | .PP | |
339 | This loads GNOME help for the given application. | |
340 | Note that not much documentation currently exists in this format. | |
446a4bc8 MK |
341 | .PP |
342 | .B "ldap \- Lightweight Directory Access Protocol" | |
343 | .PP | |
fea681da MK |
344 | .RI ldap:// hostport |
345 | .br | |
346 | .RI ldap:// hostport / | |
347 | .br | |
348 | .RI ldap:// hostport / dn | |
349 | .br | |
350 | .RI ldap:// hostport / dn ? attributes | |
351 | .br | |
352 | .RI ldap:// hostport / dn ? attributes ? scope | |
353 | .br | |
354 | .RI ldap:// hostport / dn ? attributes ? scope ? filter | |
355 | .br | |
356 | .RI ldap:// hostport / dn ? attributes ? scope ? filter ? extensions | |
357 | .PP | |
358 | This scheme supports queries to the | |
359 | Lightweight Directory Access Protocol (LDAP), a protocol for querying | |
3f624b93 | 360 | a set of servers for hierarchically organized information |
fea681da | 361 | (such as people and computing resources). |
034dbf3a | 362 | See |
608bf950 | 363 | .UR http://www.ietf.org\:/rfc\:/rfc2255.txt |
034dbf3a | 364 | RFC\ 2255 |
fea681da | 365 | .UE |
1ae6452e AC |
366 | for more information on the LDAP URL scheme. |
367 | The components of this URL are: | |
4279e42d AC |
368 | .TP |
369 | hostport | |
fea681da MK |
370 | the LDAP server to query, written as a hostname optionally followed by |
371 | a colon and the port number. | |
c13182ef | 372 | The default LDAP port is TCP port 389. |
fea681da | 373 | If empty, the client determines which the LDAP server to use. |
4279e42d AC |
374 | .TP |
375 | dn | |
fea681da MK |
376 | the LDAP Distinguished Name, which identifies |
377 | the base object of the LDAP search (see | |
608bf950 | 378 | .UR http://www.ietf.org\:/rfc\:/rfc2253.txt |
331da7c3 | 379 | RFC\ 2253 |
fea681da MK |
380 | .UE |
381 | section 3). | |
4279e42d AC |
382 | .TP |
383 | attributes | |
fea681da | 384 | a comma-separated list of attributes to be returned; |
c13182ef | 385 | see RFC\ 2251 section 4.1.5. |
331da7c3 | 386 | If omitted, all attributes should be returned. |
4279e42d AC |
387 | .TP |
388 | scope | |
fea681da MK |
389 | specifies the scope of the search, which can be one of |
390 | "base" (for a base object search), "one" (for a one-level search), | |
c13182ef MK |
391 | or "sub" (for a subtree search). |
392 | If scope is omitted, "base" is assumed. | |
4279e42d AC |
393 | .TP |
394 | filter | |
fea681da | 395 | specifies the search filter (subset of entries |
c13182ef MK |
396 | to return). |
397 | If omitted, all entries should be returned. | |
fea681da | 398 | See |
608bf950 | 399 | .UR http://www.ietf.org\:/rfc\:/rfc2254.txt |
331da7c3 | 400 | RFC\ 2254 |
fea681da MK |
401 | .UE |
402 | section 4. | |
4279e42d AC |
403 | .TP |
404 | extensions | |
fea681da MK |
405 | a comma-separated list of type=value |
406 | pairs, where the =value portion may be omitted for options not | |
c13182ef | 407 | requiring it. |
f81fb444 | 408 | An extension prefixed with a \(aq!\(aq is critical |
24b74457 | 409 | (must be supported to be valid), otherwise it is noncritical (optional). |
fea681da MK |
410 | .PP |
411 | LDAP queries are easiest to explain by example. | |
412 | Here's a query that asks ldap.itd.umich.edu for information about | |
413 | the University of Michigan in the U.S.: | |
0dac954b MK |
414 | .PP |
415 | .nf | |
fea681da | 416 | ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US |
3ffdc54f | 417 | .fi |
fea681da MK |
418 | .PP |
419 | To just get its postal address attribute, request: | |
0dac954b MK |
420 | .PP |
421 | .nf | |
fea681da | 422 | ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress |
0dac954b | 423 | .fi |
fea681da MK |
424 | .PP |
425 | To ask a host.com at port 6666 for information about the person | |
426 | with common name (cn) "Babs Jensen" at University of Michigan, request: | |
0dac954b MK |
427 | .PP |
428 | .nf | |
fea681da | 429 | ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) |
0dac954b | 430 | .fi |
446a4bc8 MK |
431 | .PP |
432 | .B "wais \- Wide Area Information Servers" | |
433 | .PP | |
fea681da MK |
434 | .RI wais:// hostport / database |
435 | .br | |
436 | .RI wais:// hostport / database ? search | |
437 | .br | |
438 | .RI wais:// hostport / database / wtype / wpath | |
439 | .PP | |
440 | This scheme designates a WAIS database, search, or document | |
441 | (see | |
608bf950 | 442 | .UR http://www.ietf.org\:/rfc\:/rfc1625.txt |
331da7c3 | 443 | IETF RFC\ 1625 |
fea681da MK |
444 | .UE |
445 | for more information on WAIS). | |
446 | Hostport is the hostname, optionally followed by a colon and port number | |
447 | (the default port number is 210). | |
448 | .PP | |
449 | The first form designates a WAIS database for searching. | |
450 | The second form designates a particular search of the WAIS database | |
451 | .IR database . | |
452 | The third form designates a particular document within a WAIS | |
453 | database to be retrieved. | |
454 | .I wtype | |
455 | is the WAIS designation of the type of the object and | |
456 | .I wpath | |
457 | is the WAIS document-id. | |
446a4bc8 MK |
458 | .PP |
459 | .B "other schemes" | |
460 | .PP | |
fea681da MK |
461 | There are many other URI schemes. |
462 | Most tools that accept URIs support a set of internal URIs | |
463 | (e.g., Mozilla has the about: scheme for internal information, | |
464 | and the GNOME help browser has the toc: scheme for various starting | |
465 | locations). | |
466 | There are many schemes that have been defined but are not as widely | |
467 | used at the current time | |
468 | (e.g., prospero). | |
469 | The nntp: scheme is deprecated in favor of the news: scheme. | |
470 | URNs are to be supported by the urn: scheme, with a hierarchical name space | |
471 | (e.g., urn:ietf:... would identify IETF documents); at this time | |
472 | URNs are not widely implemented. | |
473 | Not all tools support all schemes. | |
73d8cece | 474 | .SS Character encoding |
fea681da MK |
475 | URIs use a limited number of characters so that they can be |
476 | typed in and used in a variety of situations. | |
477 | .PP | |
478 | The following characters are reserved, that is, they may appear in a | |
479 | URI but their use is limited to their reserved purpose | |
480 | (conflicting data must be escaped before forming the URI): | |
481 | .IP | |
1ae6b2c7 AC |
482 | .in +4n |
483 | .EX | |
484 | ; / ? : @ & = + $ , | |
485 | .EE | |
486 | .in | |
fea681da MK |
487 | .PP |
488 | Unreserved characters may be included in a URI. | |
489 | Unreserved characters | |
2d72d489 | 490 | include uppercase and lowercase Latin letters, |
fea681da MK |
491 | decimal digits, and the following |
492 | limited set of punctuation marks and symbols: | |
493 | .IP | |
1ae6b2c7 AC |
494 | .in +4n |
495 | .EX | |
496 | \- _ . ! \(ti * ' ( ) | |
497 | .EE | |
498 | .in | |
fea681da MK |
499 | .PP |
500 | All other characters must be escaped. | |
501 | An escaped octet is encoded as a character triplet, consisting of the | |
502 | percent character "%" followed by the two hexadecimal digits | |
efaef3da | 503 | representing the octet code (you can use uppercase or lowercase letters |
c13182ef MK |
504 | for the hexadecimal digits). |
505 | For example, a blank space must be escaped | |
fea681da MK |
506 | as "%20", a tab character as "%09", and the "&" as "%26". |
507 | Because the percent "%" character always has the reserved purpose of | |
508 | being the escape indicator, it must be escaped as "%25". | |
509 | It is common practice to escape space characters as the plus symbol (+) | |
510 | in query text; this practice isn't uniformly defined | |
511 | in the relevant RFCs (which recommend %20 instead) but any tool accepting | |
512 | URIs with query text should be prepared for them. | |
513 | A URI is always shown in its "escaped" form. | |
514 | .PP | |
515 | Unreserved characters can be escaped without changing the semantics | |
516 | of the URI, but this should not be done unless the URI is being used | |
517 | in a context that does not allow the unescaped character to appear. | |
1ae6452e AC |
518 | For example, "%7e" is sometimes used instead of "\(ti" in an HTTP URL |
519 | path, but the two are equivalent for an HTTP URL. | |
fea681da MK |
520 | .PP |
521 | For URIs which must handle characters outside the US ASCII character set, | |
522 | the HTML 4.01 specification (section B.2) and | |
da6e8c9d AC |
523 | IETF RFC\~3986 (last paragraph of section 2.5) |
524 | recommend the following approach: | |
22356d97 | 525 | .IP (1) 5 |
0adb82e8 | 526 | translate the character sequences into UTF-8 (IETF RFC\~3629)\(emsee |
28a4c58c | 527 | .BR utf\-8 (7)\(emand |
5503c85e | 528 | then |
22356d97 | 529 | .IP (2) |
fea681da MK |
530 | use the URI escaping mechanism, that is, |
531 | use the %HH encoding for unsafe octets. | |
73d8cece | 532 | .SS Writing a URI |
eb1af896 | 533 | When written, URIs should be placed inside double quotes |
6ade226b | 534 | (e.g., "http://www.kernel.org"), |
fea681da MK |
535 | enclosed in angle brackets (e.g., <http://lwn.net>), |
536 | or placed on a line by themselves. | |
537 | A warning for those who use double-quotes: | |
538 | .B never | |
539 | move extraneous punctuation (such as the period ending a sentence or the | |
540 | comma in a list) | |
541 | inside a URI, since this will change the value of the URI. | |
542 | Instead, use angle brackets instead, or | |
543 | switch to a quoting system that never includes extraneous characters | |
544 | inside quotation marks. | |
545 | This latter system, called the 'new' or 'logical' quoting system by | |
546 | "Hart's Rules" and the "Oxford Dictionary for Writers and Editors", | |
fb0d03d1 | 547 | is preferred practice in Great Britain and in various European languages. |
c13182ef | 548 | Older documents suggested inserting the prefix "URL:" |
fea681da MK |
549 | just before the URI, but this form has never caught on. |
550 | .PP | |
551 | The URI syntax was designed to be unambiguous. | |
552 | However, as URIs have become commonplace, traditional media | |
553 | (television, radio, newspapers, billboards, etc.) have increasingly | |
554 | used abbreviated URI references consisting of | |
555 | only the authority and path portions of the identified resource | |
556 | (e.g., <www.w3.org/Addressing>). | |
557 | Such references are primarily | |
558 | intended for human interpretation rather than machine, with the | |
559 | assumption that context-based heuristics are sufficient to complete | |
560 | the URI (e.g., hostnames beginning with "www" are likely to have | |
561 | a URI prefix of "http://" and hostnames beginning with "ftp" likely | |
562 | to have a prefix of "ftp://"). | |
563 | Many client implementations heuristically resolve these references. | |
564 | Such heuristics may | |
565 | change over time, particularly when new schemes are introduced. | |
1ae6452e | 566 | Since an abbreviated URI has the same syntax as a relative URL path, |
fea681da | 567 | abbreviated URI references cannot be used where relative URIs are |
33a0ccb2 | 568 | permitted, and can be used only when there is no defined base |
fea681da MK |
569 | (such as in dialog boxes). |
570 | Don't use abbreviated URIs as hypertext links inside a document; | |
571 | use the standard format as described here. | |
3113c7f3 | 572 | .SH STANDARDS |
608bf950 SK |
573 | .UR http://www.ietf.org\:/rfc\:/rfc2396.txt |
574 | (IETF RFC\ 2396) | |
575 | .UE , | |
5465ae95 | 576 | .UR http://www.w3.org\:/TR\:/REC\-html40 |
608bf950 SK |
577 | (HTML 4.0) |
578 | .UE . | |
fea681da MK |
579 | .SH NOTES |
580 | Any tool accepting URIs (e.g., a web browser) on a Linux system should | |
6116ff44 MK |
581 | be able to handle (directly or indirectly) all of the |
582 | schemes described here, including the man: and info: schemes. | |
583 | Handling them by invoking some other program is | |
584 | fine and in fact encouraged. | |
fea681da MK |
585 | .PP |
586 | Technically the fragment isn't part of the URI. | |
587 | .PP | |
1ae6452e | 588 | For information on how to embed URIs (including URLs) in a data format, |
fea681da MK |
589 | see documentation on that format. |
590 | HTML uses the format <A HREF="\fIuri\fP"> | |
591 | .I text | |
592 | </A>. | |
593 | Texinfo files use the format @uref{\fIuri\fP}. | |
3f624b93 | 594 | Man and mdoc have the recently added UR macro, or just include the |
fea681da MK |
595 | URI in the text (viewers should be able to detect :// as part of a URI). |
596 | .PP | |
6116ff44 MK |
597 | The GNOME and KDE desktop environments currently vary in the URIs |
598 | they accept, in particular in their respective help browsers. | |
fea681da MK |
599 | To list man pages, GNOME uses <toc:man> while KDE uses <man:(index)>, and |
600 | to list info pages, GNOME uses <toc:info> while KDE uses <info:(dir)> | |
601 | (the author of this man page prefers the KDE approach here, though a more | |
602 | regular format would be even better). | |
603 | In general, KDE uses <file:/cgi-bin/> as a prefix to a set of generated | |
604 | files. | |
605 | KDE prefers documentation in HTML, accessed via the | |
606 | <file:/cgi-bin/helpindex>. | |
607 | GNOME prefers the ghelp scheme to store and find documentation. | |
608 | Neither browser handles file: references to directories at the time | |
609 | of this writing, making it difficult to refer to an entire directory with | |
610 | a browsable URI. | |
6116ff44 MK |
611 | As noted above, these environments differ in how they handle the |
612 | info: scheme, probably the most important variation. | |
fea681da MK |
613 | It is expected that GNOME and KDE |
614 | will converge to common URI formats, and a future | |
615 | version of this man page will describe the converged result. | |
616 | Efforts to aid this convergence are encouraged. | |
2b2581ee | 617 | .SS Security |
fea681da | 618 | A URI does not in itself pose a security threat. |
1ae6452e AC |
619 | There is no general guarantee that a URL, which at one time |
620 | located a given resource, will continue to do so. | |
621 | Nor is there any | |
622 | guarantee that a URL will not locate a different resource at some | |
623 | later point in time; such a guarantee can be | |
624 | obtained only from the person(s) controlling that namespace and the | |
625 | resource in question. | |
626 | .PP | |
627 | It is sometimes possible to construct a URL such that an attempt to | |
628 | perform a seemingly harmless operation, such as the | |
629 | retrieval of an entity associated with the resource, will in fact | |
630 | cause a possibly damaging remote operation to occur. | |
631 | The unsafe URL | |
632 | is typically constructed by specifying a port number other than that | |
c13182ef MK |
633 | reserved for the network protocol in question. |
634 | The client unwittingly contacts a site that is in fact | |
635 | running a different protocol. | |
1ae6452e AC |
636 | The content of the URL contains instructions that, when |
637 | interpreted according to this other protocol, cause an unexpected | |
638 | operation. | |
639 | An example has been the use of a gopher URL to cause an | |
640 | unintended or impersonating message to be sent via a SMTP server. | |
641 | .PP | |
642 | Caution should be used when using any URL that specifies a port | |
643 | number other than the default for the protocol, especially when it is | |
644 | a number within the reserved space. | |
fea681da MK |
645 | .PP |
646 | Care should be taken when a URI contains escaped delimiters for a | |
647 | given protocol (for example, CR and LF characters for telnet | |
c13182ef MK |
648 | protocols) that these are not unescaped before transmission. |
649 | This might violate the protocol, but avoids the potential for such | |
fea681da MK |
650 | characters to be used to simulate an extra operation or parameter in |
651 | that protocol, which might lead to an unexpected and possibly harmful | |
652 | remote operation to be performed. | |
653 | .PP | |
654 | It is clearly unwise to use a URI that contains a password which is | |
c13182ef MK |
655 | intended to be secret. |
656 | In particular, the use of a password within | |
84c517a4 MK |
657 | the "userinfo" component of a URI is strongly recommended against except |
658 | in those rare cases where the "password" parameter is intended to be public. | |
fea681da | 659 | .SH BUGS |
fea681da MK |
660 | Documentation may be placed in a variety of locations, so there |
661 | currently isn't a good URI scheme for general online documentation | |
662 | in arbitrary formats. | |
663 | References of the form | |
664 | <file:///usr/doc/ZZZ> don't work because different distributions and | |
665 | local installation requirements may place the files in different | |
666 | directories | |
6116ff44 MK |
667 | (it may be in /usr/doc, or /usr/local/doc, or /usr/share, |
668 | or somewhere else). | |
fea681da MK |
669 | Also, the directory ZZZ usually changes when a version changes |
670 | (though filename globbing could partially overcome this). | |
6116ff44 MK |
671 | Finally, using the file: scheme doesn't easily support people |
672 | who dynamically load documentation from the Internet (instead of | |
9ee4a2b6 | 673 | loading the files onto a local filesystem). |
fea681da | 674 | A future URI scheme may be added (e.g., "userdoc:") to permit |
6116ff44 MK |
675 | programs to include cross-references to more detailed documentation |
676 | without having to know the exact location of that documentation. | |
9ee4a2b6 | 677 | Alternatively, a future version of the filesystem specification may |
fea681da MK |
678 | specify file locations sufficiently so that the file: scheme will |
679 | be able to locate documentation. | |
680 | .PP | |
681 | Many programs and file formats don't include a way to incorporate | |
682 | or implement links using URIs. | |
683 | .PP | |
684 | Many programs can't handle all of these different URI formats; there | |
685 | should be a standard mechanism to load an arbitrary URI that automatically | |
6116ff44 | 686 | detects the users' environment (e.g., text or graphics, |
3f624b93 | 687 | desktop environment, local user preferences, and currently executing |
6116ff44 | 688 | tools) and invokes the right tool for any URI. |
fd7f0a7f MK |
689 | .\" .SH AUTHOR |
690 | .\" David A. Wheeler (dwheeler@dwheeler.com) wrote this man page. | |
47297adb | 691 | .SH SEE ALSO |
fea681da MK |
692 | .BR lynx (1), |
693 | .BR man2html (1), | |
694 | .BR mailaddr (7), | |
cd415e73 | 695 | .BR utf\-8 (7) |
5711c04f | 696 | .PP |
608bf950 | 697 | .UR http://www.ietf.org\:/rfc\:/rfc2255.txt |
baf17bc4 | 698 | IETF RFC\ 2255 |
fea681da | 699 | .UE |