RFC 1738

Uniform Resource Locators (URL)

๐Ÿ“… published December 1994, from ietf

RFC 1738: Uniform Resource Locators (URL) ๐ŸŒˆ

Bestie, this is RFC 1738, the doc that gave us URLs! ๐Ÿ’– It's a Request for Comments from the Network Working Group, in the Standards Track category, and it's dated December 1994 โœจ. The editors are T. Berners-Lee (CERN), L. Masinter (Xerox Corporation), and M. McCahill (University of Minnesota) ๐Ÿ‘‘. The title block doesn't list anything it obsoletes or updates, so no drama there ๐Ÿ™ˆ.

Status of this Memo ๐Ÿ“œ

Okay so this doc specifies an Internet standards track protocol for the Internet community ๐ŸŒ, and it literally requests discussion and suggestions for improvements ๐Ÿซถ. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐Ÿ”ฅ. Distribution of this memo is unlimited ๐Ÿ’….

Abstract ๐Ÿ’Œ

This doc specifies a Uniform Resource Locator (URL), the syntax and semantics of formalized information for location and access of resources via the Internet โœจ.

1. Introduction ๐ŸŽ€

This doc describes the syntax and semantics for a compact string representation for a resource available via the Internet ๐Ÿฆ‹. These strings are called "Uniform Resource Locators" (URLs) ๐Ÿ’œ.

The spec is derived from concepts introduced by the World-Wide Web global information initiative ๐ŸŒ, whose use of such objects dates from 1990 and is described in "Universal Resource Identifiers in WWW", RFC 1630 ๐Ÿงš. The specification of URLs is designed to meet the requirements laid out in "Functional Requirements for Internet Resource Locators" [12] ๐Ÿ’–.

This doc was written by the URI working group of the Internet Engineering Task Force ๐Ÿซถ. Comments may be addressed to the editors, or to the URI-WG <uri@bunyip.com>. Discussions of the group are archived at <URL:http://www.acl.lanl.gov/URI/archive/uri-archive.index.html> ๐Ÿ“š.

2. General URL Syntax ๐ŸŒธ

Just like there are tons of different methods of access to resources, there are several schemes for describing where those resources are ๐Ÿ—บ๏ธ.

The generic syntax for URLs gives you a framework for new schemes to be set up using protocols other than the ones defined in this doc ๐Ÿงฉ.

URLs are used to "locate" resources by providing an abstract identification of the resource location ๐Ÿ“. Once a resource is located, a system may perform a variety of operations on it, as might be characterized by words like "access", "update", "replace", and "find attributes" ๐Ÿ’…. In general, only the "access" method needs to be specified for any URL scheme ๐Ÿ‘‘.

2.1. The main parts of URLs ๐Ÿงš

A full BNF description of the URL syntax is given in Section 5 ๐Ÿ“–.

In general, URLs are written like this:

<scheme>:<scheme-specific-part>

A URL contains the name of the scheme being used (<scheme>), followed by a colon and then a string (the <scheme-specific-part>) whose interpretation depends on the scheme ๐ŸŒˆ.

Scheme names consist of a sequence of characters. The lower case letters "a"--"z", digits, and the characters plus (+), period (.), and hyphen (-) are allowed. For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow HTTP as well as http) ๐Ÿซถ.

2.2. URL Character Encoding Issues ๐ŸŒธ

URLs are sequences of characters, i.e., letters, digits, and special characters ๐Ÿ”ค. A URL may be represented in a variety of ways, e.g., ink on paper, or a sequence of octets in a coded character set ๐Ÿ–‹๏ธ. The interpretation of a URL depends only on the identity of the characters used ๐Ÿ’œ.

In most URL schemes, the sequences of characters in different parts of a URL are used to represent sequences of octets used in Internet protocols. For example, in the ftp scheme, the host name, directory name, and file names are such sequences of octets, represented by parts of the URL. Within those parts, an octet may be represented by the character that has that octet as its code within the US-ASCII [20] coded character set ๐Ÿ“.

In addition, octets may be encoded by a character triplet consisting of the character % followed by the two hexadecimal digits (from 0123456789ABCDEF) which form the hexadecimal value of the octet. (The characters abcdef may also be used in hexadecimal encodings.) ๐Ÿง

Octets must be encoded if they have no corresponding graphic character within the US-ASCII coded character set, if the use of the corresponding character is unsafe, or if the corresponding character is reserved for some other interpretation within the particular URL scheme ๐Ÿ”’.

No corresponding graphic US-ASCII: URLs are written only with the graphic printable characters of the US-ASCII coded character set. The octets 80-FF hexadecimal are not used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent control characters; these must be encoded ๐Ÿ™ˆ.

Unsafe: Characters can be unsafe for a number of reasons ๐Ÿ˜ฌ. The space character is unsafe because significant spaces may disappear and insignificant spaces may be introduced when URLs are transcribed or typeset or subjected to the treatment of word-processing programs. The characters < and > are unsafe because they are used as the delimiters around URLs in free text; the quote mark (""") is used to delimit URLs in some systems. The character # is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it. The character % is unsafe because it is used for encodings of other characters. Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are {, }, |, \, ^, ~, [, ], and `.

All unsafe characters must always be encoded within a URL. For example, the character # must be encoded within URLs even in systems that do not normally deal with fragment or anchor identifiers, so that if the URL is copied into another system that does use them, it will not be necessary to change the URL encoding ๐Ÿงท.

Reserved: Many URL schemes reserve certain characters for a special meaning: their appearance in the scheme-specific part of the URL has a designated semantics. If the character corresponding to an octet is reserved in a scheme, the octet must be encoded. The characters ;, /, ?, :, @, =, and & are the characters which may be reserved for special meaning within a scheme. No other characters may be reserved within a scheme โœจ.

Usually a URL has the same interpretation when an octet is represented by a character and when it is encoded. However, this is not true for reserved characters: encoding a character reserved for a particular scheme may change the semantics of a URL ๐Ÿ’€.

Thus, only alphanumerics, the special characters $-_.+!*'(),, and reserved characters used for their reserved purposes may be used unencoded within a URL ๐ŸŒท.

On the other hand, characters that are not required to be encoded (including alphanumerics) may be encoded within the scheme-specific part of a URL, as long as they are not being used for a reserved purpose ๐Ÿฆ‹.

In some cases, URLs are used to locate resources that contain pointers to other resources. In some cases, those pointers are represented as relative links, where the expression of the location of the second resource is in terms of "in the same place as this one except with the following relative path". Relative links are not described in this document. However, the use of relative links depends on the original URL containing a hierarchical structure against which the relative link is based ๐ŸŒณ.

Some URL schemes (such as the ftp, http, and file schemes) contain names that can be considered hierarchical; the components of the hierarchy are separated by / ๐ŸŒฒ.

3. Specific Schemes ๐Ÿ’œ

The mapping for some existing standard and experimental protocols is outlined in the BNF syntax definition. Notes on particular protocols follow. The schemes covered are:

   ftp                     File Transfer protocol
   http                    Hypertext Transfer Protocol
   gopher                  The Gopher protocol
   mailto                  Electronic mail address
   news                    USENET news
   nntp                    USENET news using NNTP access
   telnet                  Reference to interactive sessions
   wais                    Wide Area Information Servers
   file                    Host-specific file names
   prospero                Prospero Directory Service

Other schemes may be specified by future specifications. Section 4 of this document describes how new schemes may be registered, and lists some scheme names that are under development ๐Ÿ”ฎ.

3.1. Common Internet Scheme Syntax ๐ŸŒ

While the syntax for the rest of the URL may vary depending on the particular scheme selected, URL schemes that involve the direct use of an IP-based protocol to a specified host on the Internet use a common syntax for the scheme-specific data:

//<user>:<password>@<host>:<port>/<url-path>

Some or all of the parts <user>:<password>@, :<password>, :<port>, and /<url-path> may be excluded. The scheme-specific data starts with a double slash // to indicate that it complies with the common Internet scheme syntax. The different components obey the following rules ๐Ÿ’–:

  • user: An optional user name. Some schemes (e.g., ftp) allow the specification of a user name.
  • password: An optional password. If present, it follows the user name, separated from it by a colon.

The user name (and password), if present, are followed by a commercial at-sign @. Within the user and password field, any :, @, or / must be encoded ๐Ÿ”.

Note that an empty user name or password is different than no user name or password; there is no way to specify a password without specifying a user name. E.g., <URL:ftp://@host.com/> has an empty user name and no password, <URL:ftp://host.com/> has no user name, while <URL:ftp://foo:@host.com/> has a user name of "foo" and an empty password ๐Ÿ™ƒ.

  • host: The fully qualified domain name of a network host, or its IP address as a set of four decimal digit groups separated by ".". Fully qualified domain names take the form as described in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123 [5]: a sequence of domain labels separated by ".", each domain label starting and ending with an alphanumerical character and possibly also containing "-" characters. The rightmost domain label will never start with a digit, though, which syntactically distinguishes all domain names from the IP addresses ๐Ÿง .
  • port: The port number to connect to. Most schemes designate protocols that have a default port number. Another port number may optionally be supplied, in decimal, separated from the host by a colon. If the port is omitted, the colon is as well ๐Ÿ”Œ.
  • url-path: The rest of the locator consists of data specific to the scheme, and is known as the "url-path". It supplies the details of how the specified resource can be accessed. Note that the / between the host (or port) and the url-path is NOT part of the url-path ๐Ÿ‘‘.

The url-path syntax depends on the scheme being used, as does the manner in which it is interpreted ๐Ÿฆ‹.

3.2. FTP โœจ

okay bestie so FTP URLs are how you point at files and directories on Internet hosts you can reach with the FTP protocol (RFC959) ๐Ÿ“๐Ÿ’–. An FTP URL follows the syntax from Section 3.1. If :<port> is left out, the port defaults to 21 ๐ŸŽ€.

3.2.1. FTP Name and Password ๐Ÿ”‘

a user name and password can be supplied, and they get used in the ftp "USER" and "PASS" commands once you've made the connection to the FTP server ๐Ÿ’…. if there's no user name or password and the server asks for one, the "anonymous" FTP conventions kick in, like so:

  • The user name "anonymous" is supplied.
  • The password is supplied as the Internet e-mail address of the end user accessing the resource.

if the URL gives a user name but no password, and the remote server asks for a password, the program reading the FTP URL should ask the user for one ๐Ÿซถ.

3.2.2. FTP url-path ๐ŸŒธ

the url-path of an FTP URL looks like this:

<cwd1>/<cwd2>/.../<cwdN>/<name>;type=<typecode>

so <cwd1> through <cwdN> and <name> are strings (possibly encoded), and <typecode> is one of the characters "a", "i", or "d" ๐Ÿฆ‹. the ;type=<typecode> part may be omitted. the <cwdx> and <name> parts may be empty. the whole url-path may be omitted too, including the "/" that separates it from the prefix with the user, password, host, and port. it's giving minimalism ๐Ÿงš

the url-path gets read as a series of FTP commands, like this:

  • Each of the <cwd> elements is supplied, one after another, as the argument to a CWD (change working directory) command.
  • If the typecode is "d", perform a NLST (name list) command with <name> as the argument, and read the results as a file directory listing.
  • Otherwise, perform a TYPE command with <typecode> as the argument, and then access the file whose name is <name> (for example, using the RETR command.)

okay this part is so important ๐Ÿ‘€. within a name or CWD component, the characters "/" and ";" are reserved and must be encoded. the components get decoded before they're used in the FTP protocol. so if the right FTP sequence for a file needs a string with a "/" as an argument to a CWD or RETR command, you have to encode each "/" ๐Ÿ’….

here's the iconic example ๐Ÿ’€. <URL:ftp://myname@host.dom/%2Fetc/motd> means you FTP to "host.dom", log in as "myname" (prompting for a password if it's asked for), and then run "CWD /etc" and then "RETR motd" โœจ. that's a totally different vibe from <URL:ftp://myname@host.dom/etc/motd>, which would do "CWD etc" and then "RETR motd". the initial "CWD" might run relative to the default directory for "myname" ๐Ÿ™ˆ. and then there's <URL:ftp://myname@host.dom//etc/motd>, which would do "CWD " with a null argument, then "CWD etc", and then "RETR motd". not the same at all, bestie ๐Ÿ˜ญ.

FTP URLs can also be used for other operations. for example, you can update a file on a remote file server, or infer information about it from the directory listings. the mechanism for doing that isn't spelled out here ๐ŸŒˆ.

3.2.3. FTP Typecode is Optional ๐Ÿคทโ€โ™€๏ธ

the whole ;type=<typecode> part of an FTP URL is optional. if it's left out, the client program reading the URL has to guess the right mode to use. usually the data content type of a file can only be guessed from the name, like from its suffix, and then the right type code for transferring the file can be worked out from the file's actual data content ๐Ÿ“„โœจ.

3.2.4 Hierarchy ๐ŸŒณ

on some file systems, the "/" used to show the hierarchy in the URL matches the delimiter used to build a file name hierarchy. so the filename can look a lot like the URL path. but this does NOT mean the URL is a Unix filename ๐Ÿ™…โ€โ™€๏ธ. not me thinking it was ๐Ÿ’€.

3.2.5. Optimization โšก

clients using FTP can add extra heuristics to make things faster ๐Ÿš€. for some FTP servers, for example, it may be reasonable to keep the control connection open while accessing multiple URLs from the same server. BUT there's no common hierarchical model to the FTP protocol, so if a directory change command has been given, it's impossible in general to figure out what sequence to send to navigate to another directory for a second retrieval, if the paths are different. the only reliable algorithm is to disconnect and reestablish the control connection ๐Ÿ˜ญ๐Ÿซ .


3.3. HTTP ๐ŸŒ

the HTTP URL scheme is used to designate Internet resources you can reach using HTTP (HyperText Transfer Protocol) ๐Ÿ’œ.

the HTTP protocol is specified somewhere else. this spec only describes the syntax of HTTP URLs, so we're just focusing on the URL part, bestie ๐Ÿง.

an HTTP URL takes this form:

http://<host>:<port>/<path>?<searchpart>

where <host> and <port> are as described in Section 3.1. if :<port> is omitted, the port defaults to 80. no user name or password is allowed ๐Ÿšซ. <path> is an HTTP selector, and <searchpart> is a query string. the <path> is optional, and so is the <searchpart> and its preceding "?" ๐Ÿ’…. if neither <path> nor <searchpart> is present, the "/" may also be omitted.

within the <path> and <searchpart> components, "/", ";", and "?" are reserved ๐Ÿ”’. the "/" character may be used within HTTP to show a hierarchical structure ๐ŸŒฒ.


3.4. GOPHER ๐Ÿฆ•

the Gopher URL scheme is used to designate Internet resources you can reach using the Gopher protocol ๐Ÿน.

the base Gopher protocol is described in RFC 1436 and supports items and collections of items (directories) ๐Ÿ“‚. the Gopher+ protocol is a set of upward compatible extensions to the base Gopher protocol and is described in [2]. Gopher+ lets you attach arbitrary sets of attributes and alternate data representations to Gopher items, and Gopher URLs can handle both Gopher and Gopher+ items and their attributes. main character energy ๐Ÿ‘‘โœจ.

3.4.1. Gopher URL syntax ๐Ÿ“

a Gopher URL takes this form:

gopher://<host>:<port>/<gopher-path>

where <gopher-path> is one of these:

<gophertype><selector>
<gophertype><selector>%09<search>
<gophertype><selector>%09<search>%09<gopher+_string>

if :<port> is omitted, the port defaults to 70. <gophertype> is a single-character field that shows the Gopher type of the resource the URL points to. the whole <gopher-path> can also be empty, in which case the delimiting "/" is optional too, and the <gophertype> defaults to "1" ๐Ÿ“.

<selector> is the Gopher selector string. in the Gopher protocol, selector strings are a sequence of octets that can contain any octets except these:

  • 09 hexadecimal (US-ASCII HT or tab)
  • 0A hexadecimal (US-ASCII character LF)
  • 0D (US-ASCII character CR)

Gopher clients pick which item to retrieve by sending the Gopher selector string to a Gopher server ๐Ÿ“ฌ.

within the <gopher-path>, no characters are reserved ๐Ÿซถ.

some Gopher <selector> strings start with a copy of the <gophertype> character, so that character shows up twice in a row. the selector string can also be an empty string, and that's how Gopher clients refer to the top-level directory on a Gopher server ๐ŸŒธ.

3.4.2 Specifying URLs for Gopher Search Engines ๐Ÿ”

if the URL refers to a search you want submitted to a Gopher search engine, the selector gets followed by an encoded tab (%09) and the search string. to submit a search, the Gopher client sends the <selector> string (after decoding), a tab, and the search string to the Gopher server ๐Ÿงš.

3.4.3 URL syntax for Gopher+ items ๐Ÿ’Ž

URLs for Gopher+ items have a second encoded tab (%09) and a Gopher+ string. note that in this case the %09<search> string must be supplied, even though the <search> element can be the empty string ๐Ÿ™ˆ.

the <gopher+_string> is used to represent the info needed to retrieve the Gopher+ item. Gopher+ items can have alternate views, arbitrary sets of attributes, and electronic forms attached to them ๐Ÿฆ‹.

to retrieve the data for a Gopher+ URL, a client connects to the server and sends the Gopher selector, followed by a tab and the search string (which can be empty), followed by a tab and the Gopher+ commands ๐Ÿ“ค.

3.4.4 Default Gopher+ data representation ๐ŸŽจ

when a Gopher server returns a directory listing to a client, the Gopher+ items get tagged with either a "+" (for Gopher+ items) or a "?" (for Gopher+ items that have a +ASK form associated with them). a Gopher URL whose Gopher+ string is only a "+" refers to the default view (data representation) of the item. a Gopher+ string that's only a "?" refers to an item with a Gopher electronic form attached ๐Ÿ’….

3.4.5 Gopher+ items with electronic forms ๐Ÿ“‹

Gopher+ items with a +ASK associated with them (so, the ones tagged with a "?") make the client fetch the item's +ASK attribute to get the form definition. then the user fills out the form, and the responses go back along with the selector string to retrieve the item. Gopher+ clients know how to do this, but they depend on the "?" tag in the Gopher+ item description to know when to handle this case. the "?" is used in the Gopher+ string so it matches how the Gopher+ protocol uses the symbol ๐Ÿซถโœจ.

3.4.6 Gopher+ item attribute collections ๐Ÿ—‚๏ธ

to refer to the Gopher+ attributes of an item, the Gopher URL's Gopher+ string is "!" or "$". "!" refers to all of a Gopher+ item's attributes. "$" refers to all the item attributes for all items in a Gopher directory ๐ŸŒˆ.

3.4.7 Referring to specific Gopher+ attributes ๐ŸŽฏ

to refer to specific attributes, the URL's gopher+_string is !<attribute_name> or $<attribute_name>. for example, to refer to the attribute holding an item's abstract, the gopher+_string would be !+ABSTRACT ๐Ÿ“–.

to refer to several attributes, the gopher+_string is made of the attribute names separated by coded spaces. for example, !+ABSTRACT%20+SMELL refers to the +ABSTRACT and +SMELL attributes of an item ๐Ÿ‘ƒโœจ.

3.4.8 URL syntax for Gopher+ alternate views ๐ŸŒ

Gopher+ allows for optional alternate data representations (alternate views) of items. to retrieve a Gopher+ alternate view, a Gopher+ client sends the right view and language identifier (found in the item's +VIEW attribute). to refer to a specific alternate view, the URL's Gopher+ string takes this form:

+<view_name>%20<language_name>

for example, a Gopher+ string of +application/postscript%20Es_ES refers to the Spanish language postscript alternate view of a Gopher+ item ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ’•.

3.4.9 URL syntax for Gopher+ electronic forms ๐Ÿงพ

the gopher+_string for a URL that refers to an item referenced by a Gopher+ electronic form (an ASK block) filled out with specific values is a coded version of what the client sends to the server. the gopher+_string is of this form:

+%091%0D%0A+-1%0D%0A<ask_item1_value>%0D%0A<ask_item2_value>%0D%0A.%0D%0A

to retrieve this item, the Gopher client sends:

       <a_gopher_selector><tab>+<tab>1<cr><lf>
       +-1<cr><lf>
       <ask_item1_value><cr><lf>
       <ask_item2_value><cr><lf>
       .<cr><lf>

to the Gopher server ๐Ÿฆ‹๐Ÿ’–.

3.5. MAILTO ๐Ÿ’Œ

okay so the mailto URL scheme is how you point at someone's internet mailing address ๐Ÿ“ฌ (a person's or a service's). no extra info beyond that mailing address is there or implied โœจ

a mailto URL looks like this:

mailto:<rfc822-addr-spec>

where <rfc822-addr-spec> is (the encoding of an) addr-spec, as specified in RFC 822 [6]. within mailto URLs there are no reserved characters ๐Ÿซถ

bestie, don't skip this one ๐Ÿ™ˆ the percent sign ("%") shows up a lot in RFC 822 addresses and it must be encoded.

unlike a lot of URLs, mailto doesn't point at a data object you can grab directly. there's no sense in which it designates an object ๐Ÿ’… it has a totally different vibe from the message/external-body type in MIME.


3.6. NEWS ๐Ÿ“ฐ

the news URL scheme is for referring to either newsgroups or individual articles of USENET news, as specified in RFC 1036 ๐ŸŒˆ

a news URL takes one of two forms:

news:<newsgroup-name>
news:<message-id>

a <newsgroup-name> is a period-delimited hierarchical name, like "comp.infosystems.www.misc" ๐Ÿ—‚๏ธ a <message-id> matches the Message-ID of section 2.1.5 of RFC 1036, just without the enclosing "<" and ">". it looks like <unique>@<full_domain_name>. you can tell a message identifier apart from a newsgroup name by the "@" (commercial at) character. no extra characters are reserved within the components of a news URL โœจ

if <newsgroup-name> is "*" (as in <URL:news:*>), it's used to refer to "all available news groups" ๐Ÿคฏ

news URLs are kinda unusual. on their own they don't have enough info to pin down a single resource, so they're location-independent ๐ŸŒ


3.7. NNTP ๐Ÿ›ฐ๏ธ

the nntp URL scheme is an alternative way to reference news articles. it's useful for specifying news articles from NNTP servers (RFC 977) ๐ŸŽ€

an nntp URL takes the form:

nntp://<host>:<port>/<newsgroup-name>/<article-number>

where <host> and <port> are as described in Section 3.1. if :<port> is omitted, the port defaults to 119 ๐Ÿ”ข

the <newsgroup-name> is the name of the group, while the <article-number> is the numeric id of the article inside that newsgroup ๐Ÿ’–

heads up ๐Ÿ™… nntp: URLs point to a unique location for the article resource, but most NNTP servers on the Internet today are only set up to allow access from local clients. so nntp URLs don't designate globally accessible resources. that's why the news: form of URL is preferred as a way to identify news articles ๐Ÿ‘‘


3.8. TELNET ๐Ÿ–ฅ๏ธ

the Telnet URL scheme designates interactive services that may be accessed by the Telnet protocol ๐Ÿงš

a telnet URL takes the form:

telnet://<user>:<password>@<host>:<port>/

as specified in Section 3.1. the final "/" character may be omitted. if :<port> is omitted, the port defaults to 23. the :<password> can be omitted too, along with the whole <user>:<password> part ๐Ÿ™ˆ

this URL doesn't designate a data object, it designates an interactive service ๐Ÿ’œ remote interactive services vary wildly in how they let you log in. in practice, the <user> and <password> you supply are advisory only. clients accessing a telnet URL just tell the user the suggested username and password ๐Ÿซ 


3.9. WAIS ๐Ÿ”

the WAIS URL scheme designates WAIS databases, searches, or individual documents available from a WAIS database ๐Ÿ“ WAIS is described in [7]. the WAIS protocol is described in RFC 1625 [17]. even though the WAIS protocol is based on Z39.50-1988, the WAIS URL scheme is not intended for use with arbitrary Z39.50 services ๐Ÿ’…

a WAIS URL takes one of the following forms:

wais://<host>:<port>/<database>
wais://<host>:<port>/<database>?<search>
wais://<host>:<port>/<database>/<wtype>/<wpath>

where <host> and <port> are as described in Section 3.1. if :<port> is omitted, the port defaults to 210 ๐ŸŒธ the first form designates a WAIS database that's available for searching. the second form designates a particular search. <database> is the name of the WAIS database being queried โœจ

the third form designates a particular document within a WAIS database to be retrieved. in this form, <wtype> is the WAIS designation of the object's type. a lot of WAIS implementations require that a client know the "type" of an object before retrieval. the type gets returned along with the internal object identifier in the search response ๐Ÿค“ the <wtype> is included in the URL so the client reading the URL has enough info to actually retrieve the document ๐Ÿฆ‹

the <wpath> of a WAIS URL consists of the WAIS document-id, encoded as necessary using the method described in Section 2.2. the WAIS document-id should be treated opaquely. it may only be decomposed by the server that issued it ๐Ÿ”’


3.10 FILES ๐Ÿ“

the file URL scheme designates files accessible on a particular host computer. unlike most other URL schemes, this one doesn't designate a resource that's universally accessible over the Internet ๐Ÿ™ƒ

a file URL takes the form:

file://<host>/<path>

where <host> is the fully qualified domain name of the system the <path> is accessible on, and <path> is a hierarchical directory path of the form <directory>/<directory>/.../<name> ๐Ÿ—บ๏ธ

for example, a VMS file:

DISK$USER:[MY.NOTES]NOTE123456.TXT

might become:

<URL:file://vms.host.edu/disk$user/my/notes/note12345.txt>

as a special case, <host> can be the string "localhost" or the empty string. this gets interpreted as `the machine from which the URL is being interpreted'. iconic ๐Ÿ‘‘

the file URL scheme is unusual because it doesn't specify an Internet protocol or access method for these files. so its usefulness in network protocols between hosts is limited ๐Ÿฅฒ


3.11 PROSPERO ๐Ÿงญ

the Prospero URL scheme designates resources accessed via the Prospero Directory Service. the Prospero protocol is described elsewhere [14] ๐ŸŒท

a prospero URL takes the form:

prospero://<host>:<port>/<hsoname>;<field>=<value>

where <host> and <port> are as described in Section 3.1. if :<port> is omitted, the port defaults to 1525. no username or password is allowed ๐Ÿšซ

the <hsoname> is the host-specific object name in the Prospero protocol, suitably encoded. this name is opaque and gets interpreted by the Prospero server ๐Ÿ” the semicolon ";" is reserved and may not appear without quoting in the <hsoname>.

Prospero URLs get interpreted by contacting a Prospero directory server on the specified host and port. that server figures out the appropriate access methods for a resource, which might themselves be represented as different URLs ๐Ÿช„ external Prospero links are represented as URLs of the underlying access method, not as Prospero URLs.

okay, slash check ๐Ÿ”ช a slash "/" may appear in the <hsoname> without quoting, and no significance may be assumed by the application. slashes may indicate hierarchical structure on the server, but that structure is not guaranteed. many <hsoname>s begin with a slash, so the host or port gets followed by a double slash: the slash from the URL syntax, then the initial slash from the <hsoname>. (E.g., <URL:prospero://host.dom//pros/name> designates a <hsoname> of "/pros/name".) it's giving confusing but it's valid ๐Ÿ’€

after the <hsoname>, optional fields and values associated with a Prospero link may be specified as part of the URL ๐Ÿ’ซ when present, each field/value pair is separated from the others and from the rest of the URL by a ";" (semicolon). the name of the field and its value are separated by a "=" (equal sign). if present, these fields serve to identify the target of the URL. for example, the OBJECT-VERSION field can be specified to identify a specific version of an object ๐ŸŽฏ


4. REGISTRATION OF NEW SCHEMES ๐Ÿ“

a new scheme may be introduced by defining a mapping onto a conforming URL syntax, using a new prefix ๐ŸŒฑ URLs for experimental schemes may be used by mutual agreement between parties. scheme names starting with the characters "x-" are reserved for experimental purposes ๐Ÿงช

the Internet Assigned Numbers Authority (IANA) will maintain a registry of URL schemes ๐Ÿ“š any submission of a new URL scheme must include a definition of an algorithm for accessing resources within that scheme, plus the syntax for representing that scheme.

URL schemes must have demonstrable utility and operability. one way to show that is through a gateway which provides objects in the new scheme for clients using an existing protocol ๐ŸŒ‰ if the new scheme doesn't locate resources that are data objects, the properties of names in the new space must be clearly defined ๐Ÿ’Ž

new schemes should try to follow the same syntactic conventions as existing schemes, where appropriate โœจ it's likewise recommended that, where a protocol allows retrieval by URL, the client software have provision for being configured to use specific gateway locators for indirect access through new naming schemes ๐Ÿซถ

the following schemes have been proposed at various times, but this document doesn't define their syntax or use at this time. it's suggested that IANA reserve their scheme names for future definition ๐Ÿฆ‹

afs              Andrew File System global file names.
mid              Message identifiers for electronic mail.
cid              Content identifiers for MIME body parts.
nfs              Network File System (NFS) file names.
tn3270           Interactive 3270 emulation sessions.
mailserver       Access to data available from mail servers.
z39.50           Access to ANSI Z39.50 services.

5. BNF for specific URL schemes ๐Ÿงฉ

this is a BNF-like description of the Uniform Resource Locator syntax ๐Ÿค“ it uses the conventions of RFC822, except that "|" is used to designate alternatives, and brackets [] are used around optional or repeated elements. the quick version: literals are quoted with "", optional elements are enclosed in [brackets], and elements may be preceded with <n>* to designate n or more repetitions of the following element. n defaults to 0 ๐Ÿ’…

; The generic form of a URL is:

genericurl     = scheme ":" schemepart

; Specific predefined schemes are defined here; new schemes
; may be registered with IANA

url            = httpurl | ftpurl | newsurl |
                 nntpurl | telneturl | gopherurl |
                 waisurl | mailtourl | fileurl |
                 prosperourl | otherurl

; new schemes follow the general syntax
otherurl       = genericurl

; the scheme is in lower case; interpreters should use case-ignore
scheme         = 1*[ lowalpha | digit | "+" | "-" | "." ]
schemepart     = *xchar | ip-schemepart


; URL schemeparts for ip based protocols:

ip-schemepart  = "//" login [ "/" urlpath ]

login          = [ user [ ":" password ] "@" ] hostport
hostport       = host [ ":" port ]
host           = hostname | hostnumber
hostname       = *[ domainlabel "." ] toplabel
domainlabel    = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
toplabel       = alpha | alpha *[ alphadigit | "-" ] alphadigit
alphadigit     = alpha | digit
hostnumber     = digits "." digits "." digits "." digits
port           = digits
user           = *[ uchar | ";" | "?" | "&" | "=" ]
password       = *[ uchar | ";" | "?" | "&" | "=" ]
urlpath        = *xchar    ; depends on protocol see section 3.1

; The predefined schemes:

; FTP (see also RFC959)

ftpurl         = "ftp://" login [ "/" fpath [ ";type=" ftptype ]]
fpath          = fsegment *[ "/" fsegment ]
fsegment       = *[ uchar | "?" | ":" | "@" | "&" | "=" ]
ftptype        = "A" | "I" | "D" | "a" | "i" | "d"

okay the grammar is up next and it's so precise ๐Ÿงšโœจ

; FILE

fileurl        = "file://" [ host | "localhost" ] "/" fpath

; HTTP

httpurl        = "http://" hostport [ "/" hpath [ "?" search ]]
hpath          = hsegment *[ "/" hsegment ]
hsegment       = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
search         = *[ uchar | ";" | ":" | "@" | "&" | "=" ]

; GOPHER (see also RFC1436)

gopherurl      = "gopher://" hostport [ / [ gtype [ selector
                 [ "%09" search [ "%09" gopher+_string ] ] ] ] ]
gtype          = xchar
selector       = *xchar
gopher+_string = *xchar
; MAILTO (see also RFC822)

mailtourl      = "mailto:" encoded822addr
encoded822addr = 1*xchar               ; further defined in RFC822

; NEWS (see also RFC1036)

newsurl        = "news:" grouppart
grouppart      = "*" | group | article
group          = alpha *[ alpha | digit | "-" | "." | "+" | "_" ]
article        = 1*[ uchar | ";" | "/" | "?" | ":" | "&" | "=" ] "@" host

; NNTP (see also RFC977)

nntpurl        = "nntp://" hostport "/" group [ "/" digits ]

; TELNET

telneturl      = "telnet://" login [ "/" ]

; WAIS (see also RFC1625)

waisurl        = waisdatabase | waisindex | waisdoc
waisdatabase   = "wais://" hostport "/" database
waisindex      = "wais://" hostport "/" database "?" search
waisdoc        = "wais://" hostport "/" database "/" wtype "/" wpath
database       = *uchar
wtype          = *uchar
wpath          = *uchar

; PROSPERO

prosperourl    = "prospero://" hostport "/" ppath *[ fieldspec ]
ppath          = psegment *[ "/" psegment ]
psegment       = *[ uchar | "?" | ":" | "@" | "&" | "=" ]
fieldspec      = ";" fieldname "=" fieldvalue
fieldname      = *[ uchar | "?" | ":" | "@" | "&" ]
fieldvalue     = *[ uchar | "?" | ":" | "@" | "&" ]

; Miscellaneous definitions

lowalpha       = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
                 "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
                 "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
                 "y" | "z"
hialpha        = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
                 "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
                 "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"

alpha          = lowalpha | hialpha
digit          = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
                 "8" | "9"
safe           = "$" | "-" | "_" | "." | "+"
extra          = "!" | "*" | "'" | "(" | ")" | ","
national       = "{" | "}" | "|" | "\" | "^" | "~" | "[" | "]" | "`"
punctuation    = "<" | ">" | "#" | "%" | <">


reserved       = ";" | "/" | "?" | ":" | "@" | "&" | "="
hex            = digit | "A" | "B" | "C" | "D" | "E" | "F" |
                 "a" | "b" | "c" | "d" | "e" | "f"
escape         = "%" hex hex

unreserved     = alpha | digit | safe | extra
uchar          = unreserved | escape
xchar          = unreserved | reserved | escape
digits         = 1*digit

6. Security Considerations ๐Ÿ’€

okay so the URL scheme doesn't pose a security threat in itself ๐Ÿ™ˆ but bestie, here's the tea: there's no general guarantee that a URL pointing at an object will keep pointing at it. Objects get moved around on servers, so a URL that once pointed at one object can, later on, point at a totally different object. ๐Ÿ˜ญ

A URL-related security threat is that it's sometimes possible to build a URL so that a harmless idempotent operation, like retrieving the object, actually makes a possibly damaging remote operation happen ๐Ÿ’€. The unsafe URL is typically built by specifying a port number other than the one reserved for the network protocol in question. The client unwittingly contacts a server that's actually running a different protocol, and the content of the URL holds instructions that, when interpreted under that other protocol, cause an unexpected operation. One example was using gopher URLs to get a rude message sent via an SMTP server. So caution should be used with any URL that specifies a port number other than the default for the protocol, especially when it's a number within the reserved space. ๐Ÿšจ

Care should be taken when URLs contain embedded encoded delimiters for a given protocol (for example, CR and LF characters for telnet protocols) that these are not unencoded before transmission. This would violate the protocol, but it could be used to simulate an extra operation or parameter, again causing an unexpected and possibly harmful remote operation to be performed. ๐Ÿ™€

The use of URLs containing passwords that should be secret is clearly unwise. ๐Ÿ”

7. Acknowledgements ๐Ÿซถ

This paper builds on the basic WWW design (RFC 1630) and much discussion of these issues by many people on the network. The discussion was particularly stimulated by articles by Clifford Lynch, Brewster Kahle [10] and Wengyik Yeong [18]. Contributions from John Curran, Clifford Neuman, Ed Vielmetti and later the IETF URL BOF and URI working group were incorporated. ๐Ÿ™Œ

Most recently, careful readings and comments by Dan Connolly, Ned Freed, Roy Fielding, Guido van Rossum, Michael Dolan, Bert Bos, John Kunze, Olle Jarnefors, Peter Svanberg and many others have helped refine this RFC. ๐Ÿ’œ


APPENDIX: Recommendations for URLs in Context ๐ŸŽ€

URIs, including URLs, are intended to be transmitted through protocols which provide a context for their interpretation.

In some cases, it will be necessary to distinguish URLs from other possible data structures in a syntactic structure. In this case, it is recommended that URLs be preceded by a prefix consisting of the characters "URL:". For example, this prefix may be used to distinguish URLs from other kinds of URIs. ๐Ÿท๏ธ

In addition, there are many occasions when URLs are included in other kinds of text. Examples include electronic mail, USENET news messages, or URLs printed on paper. In such cases, it is convenient to have a separate syntactic wrapper that delimits the URL and separates it from the rest of the text, and in particular from punctuation marks that might be mistaken for part of the URL. For this purpose, it is recommended that angle brackets ("<" and ">"), along with the prefix "URL:", be used to delimit the boundaries of the URL. This wrapper does not form part of the URL and should not be used in contexts in which delimiters are already specified. ๐Ÿง

In the case where a fragment/anchor identifier is associated with a URL (following a "#"), the identifier would be placed within the brackets as well. ๐ŸŒธ

In some cases, extra whitespace (spaces, linebreaks, tabs, etc.) may need to be added to break long URLs across lines. The whitespace should be ignored when extracting the URL. โœ‚๏ธ

No whitespace should be introduced after a hyphen ("-") character. Because some typesetters and printers may (erroneously) introduce a hyphen at the end of a line when breaking a line, the interpreter of a URL containing a line break immediately after a hyphen should ignore all unencoded whitespace around the line break, and should be aware that the hyphen may or may not actually be part of the URL. no cap, this one is a trap ๐Ÿชค

Examples:

      Yes, Jim, I found it under <URL:ftp://info.cern.ch/pub/www/doc;
      type=d> but you can probably pick it up from <URL:ftp://ds.in
      ternic.net/rfc>.  Note the warning in <URL:http://ds.internic.
      net/instructions/overview.html#WARNING>.

References

here's the reading list for the nerds ๐Ÿค“๐Ÿ“š

   [1] Anklesaria, F., McCahill, M., Lindner, P., Johnson, D.,
       Torrey, D., and B. Alberti, "The Internet Gopher Protocol
       (a distributed document search and retrieval protocol)",
       RFC 1436, University of Minnesota, March 1993.
       <URL:ftp://ds.internic.net/rfc/rfc1436.txt;type=a>

   [2] Anklesaria, F., Lindner, P., McCahill, M., Torrey, D.,
       Johnson, D., and B. Alberti, "Gopher+: Upward compatible
       enhancements to the Internet Gopher protocol",
       University of Minnesota, July 1993.
       <URL:ftp://boombox.micro.umn.edu/pub/gopher/gopher_protocol
       /Gopher+/Gopher+.txt>

   [3] Berners-Lee, T., "Universal Resource Identifiers in WWW: A
       Unifying Syntax for the Expression of Names and Addresses of
       Objects on the Network as used in the World-Wide Web", RFC
       1630, CERN, June 1994.
       <URL:ftp://ds.internic.net/rfc/rfc1630.txt>

   [4] Berners-Lee, T., "Hypertext Transfer Protocol (HTTP)",
       CERN, November 1993.
       <URL:ftp://info.cern.ch/pub/www/doc/http-spec.txt.Z>

   [5] Braden, R., Editor, "Requirements for Internet Hosts --
       Application and Support", STD 3, RFC 1123, IETF, October 1989.
       <URL:ftp://ds.internic.net/rfc/rfc1123.txt>

   [6] Crocker, D. "Standard for the Format of ARPA Internet Text
       Messages", STD 11, RFC 822, UDEL, April 1982.
       <URL:ftp://ds.internic.net/rfc/rfc822.txt>

   [7] Davis, F., Kahle, B., Morris, H., Salem, J., Shen, T., Wang, R.,
       Sui, J., and M. Grinbaum, "WAIS Interface Protocol Prototype
       Functional Specification", (v1.5), Thinking Machines
       Corporation, April 1990.
       <URL:ftp://quake.think.com/pub/wais/doc/protspec.txt>

   [8] Horton, M. and R. Adams, "Standard For Interchange of USENET
       Messages", RFC 1036, AT&T Bell Laboratories, Center for Seismic
       Studies, December 1987.
       <URL:ftp://ds.internic.net/rfc/rfc1036.txt>

   [9] Huitema, C., "Naming: Strategies and Techniques", Computer
       Networks and ISDN Systems 23 (1991) 107-110.

  [10] Kahle, B., "Document Identifiers, or International Standard
       Book Numbers for the Electronic Age", 1991.
       <URL:ftp://quake.think.com/pub/wais/doc/doc-ids.txt>

  [11] Kantor, B. and P. Lapsley, "Network News Transfer Protocol:
       A Proposed Standard for the Stream-Based Transmission of News",
       RFC 977, UC San Diego & UC Berkeley, February 1986.
       <URL:ftp://ds.internic.net/rfc/rfc977.txt>

  [12] Kunze, J., "Functional Requirements for Internet Resource
       Locators", Work in Progress, December 1994.
       <URL:ftp://ds.internic.net/internet-drafts
       /draft-ietf-uri-irl-fun-req-02.txt>

  [13] Mockapetris, P., "Domain Names - Concepts and Facilities",
       STD 13, RFC 1034, USC/Information Sciences Institute,
       November 1987.
       <URL:ftp://ds.internic.net/rfc/rfc1034.txt>

  [14] Neuman, B., and S. Augart, "The Prospero Protocol",
       USC/Information Sciences Institute, June 1993.
       <URL:ftp://prospero.isi.edu/pub/prospero/doc
       /prospero-protocol.PS.Z>

  [15] Postel, J. and J. Reynolds, "File Transfer Protocol (FTP)",
       STD 9, RFC 959, USC/Information Sciences Institute,
       October 1985.
       <URL:ftp://ds.internic.net/rfc/rfc959.txt>

  [16] Sollins, K. and L. Masinter, "Functional Requirements for
       Uniform Resource Names", RFC 1737, MIT/LCS, Xerox Corporation,
       December 1994.
       <URL:ftp://ds.internic.net/rfc/rfc1737.txt>

  [17] St. Pierre, M, Fullton, J., Gamiel, K., Goldman, J., Kahle, B.,
       Kunze, J., Morris, H., and F. Schiettecatte, "WAIS over
       Z39.50-1988", RFC 1625, WAIS, Inc., CNIDR, Thinking Machines
       Corp., UC Berkeley, FS Consulting, June 1994.
       <URL:ftp://ds.internic.net/rfc/rfc1625.txt>

  [18] Yeong, W. "Towards Networked Information Retrieval", Technical
       report 91-06-25-01, Performance Systems International, Inc.
       <URL:ftp://uu.psi.com/wp/nir.txt>, June 1991.

  [19] Yeong, W., "Representing Public Archives in the Directory",
       Work in Progress, November 1991.

  [20] "Coded Character Set -- 7-bit American Standard Code for
       Information Interchange", ANSI X3.4-1986.

Editors' Addresses ๐Ÿ’Œ

Tim Berners-Lee World-Wide Web project CERN, 1211 Geneva 23, Switzerland

Phone: +41 (22)767 3755 Fax: +41 (22)767 7155 EMail: timbl@info.cern.ch

Larry Masinter Xerox PARC 3333 Coyote Hill Road Palo Alto, CA 94034

Phone: (415) 812-4365 Fax: (415) 812-4333 EMail: masinter@parc.xerox.com

Mark McCahill

Last but not least, here's where you can find Mark McCahill ๐Ÿ’–๐ŸŽ€

Computer and Information Services,
University of Minnesota
Room 152 Shepherd Labs
100 Union Street SE
Minneapolis, MN 55455

Phone: (612) 625 1300
EMail: mpm@boombox.micro.umn.edu

That's the whole contact list, bestie ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from