The parts of a web address: scheme, domain, port, path, query and fragment

Support & Account·· 34 views· 4 min read

The short answer: a web address (a URL) is read from left to right, in pieces, and each piece is handled by a different part of the chain. Take this one: https://www.yourcompany.com:443/shop/shoes?colour=blue&page=2#sizes. https is the scheme, www.yourcompany.com is the host name (DNS turns it into an IP), 443 is the port (usually hidden), /shop/shoes is the path (the server decides what it means), ?colour=blue&page=2 is the query string, and #sizes is the fragment, which never even leaves the browser. Knowing which piece is which tells you who to ask when a link fails.

Each piece, what it does and who reads it

Piece What it does and who reads it
Scheme: https:// How to talk to the server. With https the connection is encrypted, with http it is not. The browser reads it. See HTTP or HTTPS.
Host: www.yourcompany.com The domain, with or without a subdomain in front. DNS translates the name into an IP address. Upper and lower case make no difference here. With and without www are two different names: www or no www.
Port: :443 The “door” on the server where the service answers. It stays hidden when it is the usual one (80 for http, 443 for https). It shows up on test apps running on a VPS. If nothing answers, see ports and firewall on a VPS.
Path: /shop/shoes Which page or file. The server interprets it: it may be a real file in the site folder, or an address the application (WordPress, for example) builds. On Linux servers, upper and lower case matter.
Query string: ?colour=blue&page=2 Extra data for the page: name=value pairs, separated by &. The server or the application reads them. See query strings explained.
Fragment: #sizes A spot inside the page (the element with id="sizes"). Only the browser uses it: it is not sent to the server, so the server never sees it, never logs it and cannot redirect based on it.

Reading a failing address, piece by piece

1 Copy the whole address by clicking in the browser bar. Many browsers hide the https, and sometimes the www, until you click: what you see before clicking is not the full address.
2 Start with the host: if the error mentions DNS or “server IP address could not be found”, the problem is the domain or its DNS, before the site is even reached. See how a website works.
3 Then the scheme and port: a certificate warning is an https problem. A connection refused on a port other than 80 or 443 means nothing is listening on that port.
4 Then the path: a 404 means the server answered but did not find that path. Check it letter by letter, capitals included: error 404 on a page that should exist.
5 Then the query string: open the same page without the part starting at “?”. If it works that way, the problem is a parameter, not the page.
6 The fragment does not count for the server: removing the “#...” changes nothing on its side. If the page opens but does not jump to the section, the page is missing the element with that id.
Read the host, not the start of the address. The real domain is what sits just before the first single slash, read from right to left. In https://bank.example.com.other-site.example/login the site is other-site.example, not the bank. And anything before an “@” in the host part is not the server either. That is how many phishing messages fool people.
To see what the server answers, with no browser in between, in a terminal: curl -I https://yourcompany.com/ shows the status code (200, 301, 404) and, for a redirect, where it points. Like the server, curl ignores the fragment.

A link on your site fails and you cannot tell which piece is wrong? Send us the full address, copied from the bar, and what appears on screen.

Open a support ticket

SEE ALSO

How a website works: from the address you type to the page on your screen

Query strings explained: what comes after the question mark, and what it changes

Spaces, accents and symbols in links and file names: URL encoding without broken links

www or no www: which address to choose for your site

Error 404 on a page that should exist: the causes, in order

HTTP or HTTPS: what changes for visitors, forms and the services that call your site

RECOMMENDED PRODUCT

Register your .com domain

Secure your company name before someone else registers it. from $17.00/yr

Search a domain
Was this answer helpful? Your answer helps us improve this article.