# URL

A URL identifies a resource through a structured address whose components determine how browsers resolve and request it.

- Type: term
- Domain: Engineering & architecture
- Level: Foundational
- Last reviewed: 2026-10-19
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/url/>)

## What it means

A Uniform Resource Locator, or URL, is a resource identifier interpreted according to a scheme. A typical web URL contains a scheme, host, optional port, path, query, and fragment. Relative references resolve against a base URL. For HTTP requests, the fragment is handled by the client rather than sent as part of the request target.

## Why it matters

URL structure affects linking, navigation, caching, sharing, and integration behavior. Confusing a host with a path or constructing addresses by raw concatenation can send users to the wrong resource or change a request’s meaning.

## When to use it

Use this model when designing links, callbacks, deep links, and resource addresses. Use platform URL parsers and encoding utilities. A syntactically valid address is not proof that its destination is safe, reachable, or authorized.

## How it works

1. Identify the scheme and the components meaningful to the workflow.
2. Resolve relative references against the intended base.
3. Construct and encode path and query values with suitable URL APIs.
4. Validate allowed destinations and schemes when user input influences navigation.
5. Test spaces, non-ASCII values, fragments, and redirects with realistic examples.

## A practical example

A search page links to a query containing an ampersand in a hotel name. Raw concatenation splits the name into separate parameters. The team uses a query-parameter API so the shared URL preserves the intended search value.

## Where it breaks

URL syntax and normalization have edge cases, and scheme behavior differs. Addresses may expose sensitive data through logs or browsing history. A stable address also requires routing and redirect policies beyond merely choosing a readable path.

## Common mistakes

- Encoding an entire URL as though it were one query value.
- Expecting the server to receive the fragment automatically.
- Treating a domain-name substring as a reliable destination check.

## Sources

1. [URL Standard](<https://url.spec.whatwg.org/>) — WHATWG · Living standard
2. [What is a URL?](<https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL>) — MDN Web Docs · Official documentation

## Related topics

- [HTTP](<https://wiki.soroush.uk/topic/http/>)
- [Endpoint](<https://wiki.soroush.uk/topic/endpoint/>)
- [Client-Side Routing](<https://wiki.soroush.uk/topic/client-side-routing/>)
