A URL (Uniform Resource Locator) is the complete address browsers use to locate an HTML page, image, stylesheet, or API endpoint on the internet. Understanding every segment of a URL helps you write reliable href links, configure canonical SEO tags, and debug routing errors quickly.
Consider https://api.example.com:8443/tutorials/html/lesson?tab=code#faq:
https://): Defines the transfer protocol—https for encrypted web traffic, http for unencrypted local servers, or mailto: / tel:.api.example.com): The domain name (and optional subdomain) pointing to the server IP address.:8443): Optional network port; standard ports :80 (HTTP) and :443 (HTTPS) are hidden automatically./tutorials/html/lesson): Locates the specific file or route on the server.?tab=code): Passes key-value filters or search terms after ?, separated by &.#faq): Scrolls straight to an element with id="faq" inside the browser without leaving the page.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML URL Paths Demo</title>
<link rel="canonical" href="https://example.com/tutorials/html/lesson/html-url-paths">
</head>
<body style="font-family: system-ui, sans-serif; padding: 20px;">
<nav>
<!-- Root-relative internal path -->
<a href="/tutorials/html">HTML Hub</a> |
<!-- Path with query parameter -->
<a href="/search?topic=html&level=beginner">Beginner HTML</a> |
<!-- Fragment jump link -->
<a href="#url-notes">Read Notes</a>
</nav>
<section id="url-notes" style="margin-top: 24px;">
<h3>Fragment Routing</h3>
<p>The #url-notes hash never gets sent to the backend server; browsers resolve it locally.</p>
</section>
</body>
</html>
http:// when https:// is available: HTTPS protects visitor privacy and avoids mixed-content browser warnings./ or without / and keep internal links and canonical URLs consistent to prevent duplicate SEO URLs.Referer headers.No. Browsers strip everything from # onward before sending the HTTP request and handle fragment scrolling on the client side.
Protocol-relative URLs are outdated now; always use explicit https:// URLs for external resources.
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With
Experiment with the code from this lesson in our interactive playground.