Definition
URL Anatomy is the structural breakdown of a Uniform Resource Locator (URL), which is the standard address used to identify and locate a specific resource on the web.
Why It Matters
Understanding URL anatomy is critical for designing proper site architectures, configuring links, setting up server redirects, and managing security.
Core Concepts
- URL Components:
- Protocol/Scheme:
http://orhttps://(secure). - Domain/Hostname:
www.example.com(points to the hosting server). - Path:
/2018/page.html(the file or directory path on the server).
- Protocol/Scheme:
https://www.example.com/blog/article.html?id=123#comments
└─┬─┘ └──────┬──────┘└───────┬───────┘ └──┬──┘ └──┬──┘
Protocol Domain Path Query Fragment
- Default Documents: Servers are configured to serve default files (usually
index.html) when a directory path is requested. - Paths:
- Absolute URLs: Complete URL including protocol and domain.
- Relative URLs: Points to a resource relative to the current file.
- Site-Root Paths: Paths starting with
/reference the root of the domain.