Deutsch
URLs & domains

URL

Also known as: web address, Uniform Resource Locator

A URL (Uniform Resource Locator) is the address of a unique resource on the web, such as an HTML page, an image or a document. Search engines identify every page they crawl and index by its URL.

What are the parts of a URL?

Text
https://example.com:443/guides/url?lang=en#parts
  • Scheme (https) names the protocol.
  • Authority (example.com:443) holds the domain, optionally with a subdomain and a port. The port is usually omitted.
  • Path (/guides/url) shows where the resource sits on the server.
  • Query string (?lang=en) carries key and value pairs for extra data. Multiple pairs are joined with &.
  • Fragment (#parts) points to a section within the page and is never sent to the server (MDN).

A URL can be absolute, with scheme and domain, or relative to the current page, for example /guides/url.

Anatomy of a URLThe example URL https://shop.example.de/shoes/sneakers/?color=red&page=2#reviews broken into parts: scheme https, host shop.example.de with subdomain shop, domain example.de and top-level domain de, path /shoes/sneakers/ with a trailing slash, query string with two parameters color=red and page=2, fragment reviews. The fragment is not sent to the server.Trailing slashhttps://shop.example.de/shoes/sneakers/?color=red&page=2#reviewsSchemeHostPathQuery stringFragmentSubdomainDomainParameterParameterTLDcountry code: ccTLDstays in the browser, is notsent to the serverSchematic. Scheme, host, path, query and fragment are components defined in RFC 3986.Subdomain, domain and TLD split the host by DNS level. Without a port, https uses port 443.
A URL broken into its parts. RFC 3986 defines scheme, host, path, query and fragment. Only the browser evaluates the fragment after #, it is not sent to the server. Sources: RFC 3986: Uniform Resource Identifier (URI), Generic Syntax; MDN: What is a URL?; MDN Glossary: TLD.

What does Google say about URLs?

Google lists these recommendations:

  • Use readable words rather than long ID numbers.
  • Separate words with hyphens, not underscores.
  • Keep casing consistent, because Google Search treats URLs as case sensitive. /APPLE and /apple are different URLs.
  • Use = between key and value and & between parameters.
  • Do not use fragments to change page content, since Google Search generally does not support them.
  • Percent-encode non-ASCII characters in href attributes and avoid session IDs in URLs.

Example

example.com/wiki/Aviation is easier to interpret than example.com/index.php?topic=42&area=3a5ebc944f41daa6f849f730f1. Both examples come from Google’s documentation.

Common mistakes

  • Inconsistent casing. Google treats /APPLE and /apple as different URLs, so both variants become separate addresses for the same page.
  • Underscores instead of hyphens. Google recommends hyphens between words.
  • Fragments to tell content apart. Google advises against using # to distinguish different content.
  • Session IDs in the URL. They create many URLs for the same content and put load on crawling.

Frequently asked questions

What is the difference between a URL and a link? A link is the clickable reference on a page. The URL is the address it points to.

Sources

  1. What is a URL? – MDN Web Docsdeveloper.mozilla.org
  2. URL structure best practices for Google Search – Google Search Centraldevelopers.google.com
  3. RFC 3986 – Uniform Resource Identifier (URI): Generic Syntax – IETFrfc-editor.org

Last updated: