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
Component
Example
Purpose
Domain extraction
Scheme or protocol
https:
Access method
Removed
Hostname
shop.example.co.uk
Network host
Retained in hostname mode
Port
:443
Network service
Removed
Path
/products/shoes
Resource location
Removed
Query
?color=blue
Parameters
Removed
Fragment
#reviews
Client-side section
Removed
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
Recognize the scheme
Identify http, https or another supported protocol without treating it as part of the host.
2
Isolate the authority
Separate credentials, hostname and port from the remainder of the URL.
3
Normalize the hostname
Lowercase labels, handle internationalized names and remove a trailing dot where appropriate.
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.
Decision
Example
Extractor treatment
Protocol
https://
Removed
Hostname
shop.example.co.uk
Kept or reduced to example.co.uk
Path
/products/shoes
Removed
Query and fragment
?color=blue#reviews
Removed
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.
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.