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.
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.
/APPLEand/appleare 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
hrefattributes 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
/APPLEand/appleas 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
- What is a URL? – MDN Web Docsdeveloper.mozilla.org
- URL structure best practices for Google Search – Google Search Centraldevelopers.google.com
- RFC 3986 – Uniform Resource Identifier (URI): Generic Syntax – IETFrfc-editor.org
Last updated: