URL Anatomy: Protocol, Hostname, Path, Query and Fragment

Break a web address into its component parts and understand exactly which pieces a URL-to-domain extractor keeps or removes.

FlashDomains Editorial·August 21, 2026·7 min read

A URL can describe how to access a resource, which server to contact, which page to request and which state or section to display. A domain name answers a narrower question: which name identifies the host or registrable site?

Consider https://shop.example.co.uk:443/products/shoes?color=blue#reviews. It is one string, but it contains several components with different jobs.

URL components at a glance

ComponentExamplePurposeDomain extraction
Scheme or protocolhttps:Access methodRemoved
Hostnameshop.example.co.ukNetwork hostRetained in hostname mode
Port:443Network serviceRemoved
Path/products/shoesResource locationRemoved
Query?color=blueParametersRemoved
Fragment#reviewsClient-side sectionRemoved

The browser’s standard URL model exposes these pieces separately. Google’s current URL structure guidance also recommends understandable structures and warns that unnecessary parameters can create many similar URLs.

Hostname, root domain and suffix inside the URL

The hostname can contain a subdomain, registrable label and public suffix. In shop.example.co.uk, shop is the subdomain, example.co.uk is the registrable root and co.uk is the public suffix. The guide to domain-name anatomy shows this hierarchy visually.

Repeatable process

Reduce a complete URL to its domain safely

Parse the URL as structured data instead of deleting text with brittle formulas.

  1. 1

    Recognize the scheme

    Identify http, https or another supported protocol without treating it as part of the host.

  2. 2

    Isolate the authority

    Separate credentials, hostname and port from the remainder of the URL.

  3. 3

    Normalize the hostname

    Lowercase labels, handle internationalized names and remove a trailing dot where appropriate.

  4. 4

    Apply the chosen boundary

    Return the full hostname or derive its registrable root using suffix rules.

Side-by-side

Which URL components survive extraction?

Domain extraction keeps network identity and removes page- or request-level detail.

DecisionExampleExtractor treatment
Protocolhttps://Removed
Hostnameshop.example.co.ukKept or reduced to example.co.uk
Path/products/shoesRemoved
Query and fragment?color=blue#reviewsRemoved

Where it helps

Why URL anatomy matters in practice

Use the cleaned output as a focused input to the next analysis—not as a substitute for that analysis.

Analytics cleanup

Understand why campaign parameters disappear from a domain-level report.

Crawler exports

Separate hostname inventory from canonical and path-level SEO analysis.

Log analysis

Group requests by host while retaining the original request target elsewhere.

Data validation

Spot values that look like URLs but lack a usable hostname.

Worked example

Dissect a URL before extracting its domain

Input

https://shop.example.co.uk:443/products/shoes?color=blue#reviews

Result

Hostname: shop.example.co.uk
Root domain: example.co.uk

Protocol, port, path, query and fragment are excluded from both outputs.

Why query strings create noisy datasets

Analytics and crawl exports often contain tracking, sorting, filter and session parameters. Several rows can point to the same host—or even the same content—while differing only after ?. Domain extraction intentionally discards that page-level state. It helps you count sites, but it cannot decide whether two complete URLs are canonical equivalents.

Why fragments are different

A fragment follows # and is normally interpreted by the client rather than sent as part of the HTTP request target. It may identify a section, tab or state. It is irrelevant when the goal is a domain list, so the extractor removes it.

Credentials, ports and unusual schemes

A URL may contain credentials before the hostname or an explicit port after it. Those values are not part of the domain. Avoid sharing live secrets in any cleanup tool; sanitize sensitive exports first. FlashDomains recognizes common web and FTP URL forms but is not intended to validate every URI scheme.

Frequently asked questions

Is the protocol part of the domain?

No. https:// is the scheme. The domain sits within the hostname portion.

Does a path affect the domain?

No. Every path beneath one hostname uses the same host identity, although paths can identify different resources.

Why not split the string at the first slash?

That shortcut mishandles protocol-free input, credentials, ports, email addresses and suffix boundaries. A URL parser plus public-suffix parser is safer.

For a direct comparison, read domain name versus URL. Then use the URL-to-domain extractor to see how your own records change.