Website Basics

What Is a URL? Structure and Components Explained

Published Şubat 5, 2025

Every resource on the internet — every page, image, file or API endpoint — has a unique address called a URL. Understanding the structure of a URL helps you navigate the web, troubleshoot issues and build better websites.

Quick answer: A URL (Uniform Resource Locator) is the complete address of a resource on the internet. It consists of a protocol (https://), domain name, optional path, optional query string and optional fragment. Example: https://example.com/articles/guide?lang=en#section1

Anatomy of a URL

Let's break down a full URL:

https://www.example.com:443/articles/guide?lang=en&page=2#summary
  • Protocolhttps:// — Defines how data is transferred. https is encrypted, http is not.
  • Subdomainwww — Optional. Most sites use www or none at all.
  • Domainexample.com — The website's registered domain name.
  • Port:443 — Usually omitted. Default is 443 for HTTPS and 80 for HTTP.
  • Path/articles/guide — Identifies the specific page or resource on the server.
  • Query string?lang=en&page=2 — Optional parameters passed to the server, starting with ?. Multiple parameters separated by &.
  • Fragment#summary — Jumps to a specific section on the page. Processed by the browser, not sent to the server.

URL vs URI vs URN

  • URL (Uniform Resource Locator) — Specifies location: https://example.com/page
  • URI (Uniform Resource Identifier) — Broader term that includes URLs
  • URN (Uniform Resource Name) — Identifies by name without location: urn:isbn:0-486-27557-4

In everyday use, URL and URI are used interchangeably.

Best Practices for URL Structure

  • Use lowercase letters only
  • Use hyphens (-) to separate words, not underscores (_)
  • Keep URLs short and descriptive
  • Include the target keyword in the path for SEO
  • Avoid unnecessary parameters in URLs that should be indexed
  • Use canonical URLs to handle duplicate content

Absolute vs Relative URLs

  • Absolute URL — Full address including protocol and domain: https://example.com/about
  • Relative URL — Path only, relative to the current page: /about or ../images/logo.png

Use absolute URLs in canonical tags, sitemaps and external links. Use relative URLs internally to make a site easier to move between environments.

Related Guides

A website is a collection of web pages stored on a server and accessible via a domain name. Learn exactly how websites work from browser to server.
Web hosting is a service that stores your website files on a server and makes them accessible on the internet. Learn the different types and how to pick the right one.
A domain name is the address people type to visit your website. Learn how domains work, how to choose one and the difference between domain types.
An IP address is a unique numerical label assigned to every device on the internet. Learn the difference between IPv4, IPv6, public and private addresses.
A CMS (Content Management System) lets you build and manage a website without coding. Learn how CMS platforms work and how to choose the right one.