URI versus URL
A URI (Uniform Resource Identifier) names a resource. A URL (Uniform Resource Locator) is a URI that also says how to reach it. Every URL is a URI, but a bare name like a book ISBN is a URI that is not a URL.
The parts
A full URL has predictable components:
- Scheme like https tells the client which protocol to speak.
- Authority holds an optional userinfo, a host, and an optional port.
- Path is the hierarchical location on the server, split by slashes.
- Query follows a question mark and carries key value pairs joined by ampersands.
- Fragment follows a hash and points at a spot inside the resource, handled only by the client.
The browser never sends the fragment to the server. Reserved characters such as spaces or slashes inside a value must be percent encoded so the structure stays unambiguous.
Why the split matters
Servers route on path and read parameters from the query. Caches key on the full URL minus the fragment. Knowing the parts lets you debug why two seemingly equal links behave differently when one carries an extra query parameter.
Key idea
A URL layers scheme, authority, path, query, and fragment into one string, and only the part before the fragment is sent to the server.