URL Components Explained: Scheme, Host, Path, Query
Learn what each part of a URL does: protocol, subdomain, domain, TLD, port, path segments, query string, and the hash fragment — with real-world examples.
Published:
Tags: url, developer-tools, web
URL Components Explained: Scheme, Host, Port, Path, Query, Fragment A URL has six or seven distinct components, and each one has its own encoding rules, parsing semantics, and common failure modes. Knowing them precisely prevents a category of bugs that are easy to introduce and hard to diagnose. This is a deep dive — one section per component. --- Scheme The scheme (also called protocol) comes before the first . It tells the client which protocol to use to retrieve the resource. Syntax rules (RFC 3986 §3.1): First character must be a letter () Subsequent characters: letters, digits, , , or Case-insensitive: and are the same scheme The after the scheme is a delimiter, not part of the scheme name When things break: Most URL parsers reject (no scheme) as an absolute URL, even though…
All articles · theproductguy.in