concept Frontend & browsers
URL structure
Read a web address, one part at a time. Learn what reaches the server—and why the fragment is different.
What it means
A URL is an address for a resource. In this HTTP(S) example, it has a scheme, a host, a path, an optional query and an optional fragment. Reading those parts separately makes a long address easier to understand. URI syntax
Try it
Example — inspect a URL without opening it. Choose a URL preset, then select a component. The highlighted text, explanation and HTTP/1.1 request example change together; Reset restores the original URL and Host selection.
Start with the original example and select Fragment. The browser representation contains #pricing, while the request target remains /guides/hosting?plan=starter. Next choose the non-default port preset: the hostname is still example.com, but the Host field is example.com:8443. A port is part of the authority, not part of the path. URL components HTTP request target
| Local preset | Origin-form target | Host field | Fragment shown separately |
|---|---|---|---|
| Original example | /guides/hosting?plan=starter | example.com | pricing |
| Plain path | /a | example.com | None |
| Non-default port | /a | example.com:8443 | b |
Selecting a component that is absent produces an explicit “not present” explanation; it does not invent an empty query parameter or an anchor. The presets deliberately contain no credentials or personal tokens. The browser's URL parser supplies normalization, so its displayed result need not preserve every spelling choice from an input string. This is a component explorer, not a DNS, connection or link-safety test. Browser URL API
One address, different jobs
The scheme, https, identifies the scheme used to access the resource. The host, example.com, identifies the host; it is not the complete URL. The path, /guides/hosting, identifies a resource within that host's space. It need not name a physical file. A query, here ?plan=starter, carries additional identifying data. Its interpretation belongs to the receiving application. URI syntax
The browser's URL API exposes these components separately. Our example uses that parser, so a supplied address is represented in its normalized form. A port can be explicit; the API's host property includes a non-default port, while hostname does not. Credentials and non-HTTP schemes are outside this explorer. URL API
What the server receives
For an ordinary HTTP/1.1 request sent directly to an origin, the request target contains the path and query. The host is supplied separately. That is why the example shows these two lines, not the whole address:
GET /guides/hosting?plan=starter HTTP/1.1
Host: example.comThis is a simplified HTTP/1.1 illustration, not a wire capture or a statement that every HTTP version uses this text format. Proxies and special request methods have other request-target forms. HTTP request target
In practice
When checking a link, ask which job you intended to change. A different host points at a different authority. A different path or query changes the requested identifier. A fragment such as #pricing identifies a secondary resource or part of a representation and is separated before dereferencing. It is not sent as part of this HTTP request target. Fragment semantics
Common misunderstanding
“Not in the request target” does not mean “secret.” Page code can read a URL's fragment and could send its value in a separate request. Do not place credentials in example URLs. The explorer uses a fixed example rather than asking for one of your private links. Browser URL representation
Key takeaways
Read the authority before interpreting a path or query. Keep hostname and host-with-port distinct, and do not send a fragment as part of an HTTP origin-form request target. A syntactically valid URL still says nothing about whether the destination exists, is trustworthy or will accept the request.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Does a fragment stay secret from the website?
No. It is excluded from the ordinary HTTP request target, but code running in the page can read the browser URL, including its fragment. Do not put secrets in a URL component.
Is a hostname the same as the Host field?
Not always. In an HTTP/1.1 request, the Host field can include a non-default port, such as example.com:8443. The hostname itself does not include that port.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 3986 — URI generic syntax
Sections 3.1–3.5. Component boundaries, authority and fragment processing.
Checked .
- WHATWG URL Standard
URL API and URL representation. Browser URL parsing, normalization and component access.
Checked .
- RFC 9112 — HTTP/1.1
Sections 3.2 and 3.2.1. Origin-form request target and the separate Host field.
Checked .