Fundamentals 10 min read

Why Do URLs Contain Two Slashes? The History and Purpose Explained

The article explains that the double slash in a URL marks the authority part per RFC 3986, originates from the Apollo Domain workstation syntax that Tim Berners‑Lee copied, and shows how different URI schemes use or omit it, including protocol‑relative URLs and modern browser UI quirks.

Java Tech Enthusiast
Java Tech Enthusiast
Java Tech Enthusiast
Why Do URLs Contain Two Slashes? The History and Purpose Explained

You type a URL like https://www.google.com and see the two slashes between https: and www. Splitting the URL reveals the scheme ( https), the host name ( www.google.com) and the path ( /…); the // sits between the scheme and the host.

According to the URI specification (RFC 3986), the characters // introduce the authority component, which tells the client “who will respond to this request”. It is a delimiter that separates the scheme from the host name.

The double slash was not invented for HTTP. In 1989 Tim Berners‑Lee saw the Apollo Domain workstation, whose file‑access syntax began with //machine_name/path/to/file to indicate a remote machine. He later said, “I just copied Apollo”. When he designed the URL syntax at CERN, he adopted this // as the marker after http: and https:.

Not every URI needs //. Schemes that do not contact a server omit it, e.g. mailto:[email protected], tel:+8613800138000, and data:text/html,<h1>Hello</h1>. These are valid URIs without an authority component.

Web developers also used // to write protocol‑relative URLs such as

<script src="//cdn.jquery.com/jquery.min.js"></script>

. The browser inherits the current page’s scheme (HTTP or HTTPS), which was handy around 2010 when sites switched between protocols. With universal HTTPS today the pattern is rarely needed.

Modern browsers often hide the scheme ( https://) in the address bar, showing only the clean domain unless the user changes settings. This UI change reflects Tim Berners‑Lee’s later comment that the two characters waste paper and ink, yet they remain in the syntax.

File URLs illustrate a special case: file:///Users/xxx/Desktop/test.html contains three slashes – the first two mark an empty authority, and the third begins the absolute path.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

URLweb standardsRFC3986URIdouble slashprotocol-relative
Java Tech Enthusiast
Written by

Java Tech Enthusiast

Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.