Connected: An Internet Encyclopedia
RFC 1808 - 2.1. URL Syntactic Components

Top: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1808
Up: 2. Relative URL Syntax
Prev: 2. Relative URL Syntax
Next: 2.2. BNF for Relative URLs

### 2.1. URL Syntactic Components

The URL syntax is dependent upon the scheme. Some schemes use reserved characters like "?" and ";" to indicate special components, while others just consider them to be part of the path. However, there is enough uniformity in the use of URLs to allow a parser to resolve relative URLs based upon a single, generic-RL syntax. This generic-RL syntax consists of six components:

          <scheme>://<net_loc>/<path>;<params>?<query>#<fragment>

each of which, except <scheme>, may be absent from a particular URL. These components are defined as follows (a complete BNF is provided in Section 2.2):

          scheme ":"   ::= scheme name, as per Section 2.1 of RFC 1738 [2].

          "//" net_loc ::= network location and login information, as per
                           Section 3.1 of RFC 1738 [2].

          "/" path     ::= URL path, as per Section 3.1 of RFC 1738 [2].

          ";" params   ::= object parameters (e.g., ";type=a" as in
                           Section 3.2.2 of RFC 1738 [2]).

          "?" query    ::= query information, as per Section 3.3 of
                           RFC 1738 [2].

          "#" fragment ::= fragment identifier.

Note that the fragment identifier (and the "#" that precedes it) is not considered part of the URL. However, since it is commonly used within the same string context as a URL, a parser must be able to recognize the fragment when it is present and set it aside as part of the parsing process.

The order of the components is important. If both <params> and <query> are present, the <query> information must occur after the <params>.

Next: 2.2. BNF for Relative URLs

Connected: An Internet Encyclopedia
RFC 1808 - 2.1. URL Syntactic Components