# URLs: Why a backslash?

**URL:** <https://boards.straightdope.com/t/urls-why-a-backslash/603971>\
**Category:** Factual Questions\
**Created:** [November 24, 2011, 2:50pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971 "2011-11-24T14:50:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://boards.straightdope.com/u/Jinx)\
**Post date:** [November 24, 2011, 2:50pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/1 "2011-11-24T14:50:00Z")

</div>

Just wondering why our computer gods who gave us the internet could not use the conventional slash in a URL? Instead, they had to give us the backslash, but was this really necessary?

---

<div class="post-metadata">

**Author:** ![Joey\_P](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joey\_P](https://boards.straightdope.com/u/Joey_P)\
**Post date:** [November 24, 2011, 2:52pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/2 "2011-11-24T14:52:03Z")

</div>

> [@Jinx](#):
>
> Just wondering why our computer gods who gave us the internet could not use the conventional slash in a URL? Instead, they had to give us the backslash, but was this really necessary?

WAG, so it would differentiate it from a DOS prompt.

(I’m not even sure why I’m answering this…we all know you’re not going to be back)

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://boards.straightdope.com/u/Jinx)\
**Post date:** [November 24, 2011, 2:59pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/3 "2011-11-24T14:59:10Z")

</div>

Thanks, Joey for the thought. Yes, the DOS sintax still lingers on in so many ways to hinder us. (Back when I can. I have a life, too, you know.)

---

<div class="post-metadata">

**Author:** ![njtt](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@njtt](https://boards.straightdope.com/u/njtt)\
**Post date:** [November 24, 2011, 3:00pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/4 "2011-11-24T15:00:30Z")

</div>

URLs do **not** use a backslash. They use a regular forward [slash](http://en.wikipedia.org/wiki/Slash_%28punctuation%29). It is DOS paths that use a backslash.

Why DOS does that, I have no idea. The slash is a regular punctuation mark, but the backslash seems to be pretty much entirely confined to computing uses.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [November 24, 2011, 3:09pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/5 "2011-11-24T15:09:33Z")

</div>

nm: ninja’ed

---

<div class="post-metadata">

**Author:** ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)\
**Post date:** [November 24, 2011, 3:37pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/6 "2011-11-24T15:37:53Z")

</div>

If it helps, Tim Berners-Lee [regrets](http://news.bbc.co.uk/2/hi/technology/8306631.stm) including the slashes and says that he could have designed URLs so that they didn’t need them.

---

<div class="post-metadata">

**Author:** ![Floater](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@Floater](https://boards.straightdope.com/u/Floater)\
**Post date:** [November 24, 2011, 3:44pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/7 "2011-11-24T15:44:55Z")

</div>

> [@njtt](#):
>
> Why DOS does that, I have no idea. The slash is a regular punctuation mark, but the backslash seems to be pretty much entirely confined to computing uses.

It’s to differentiate DOS from Unix, which was first.

---

<div class="post-metadata">

**Author:** ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)\
**Post date:** [November 24, 2011, 3:46pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/8 "2011-11-24T15:46:45Z")

</div>

[QUOTE=njtt]  
Why DOS does that, I have no idea. The slash is a regular punctuation mark, but the backslash seems to be pretty much entirely confined to computing uses.  
[/QUOTE]  
IIRC when they added directory/file structure to DOS they used a backslash because they had already used the forward slash as the switch marker.

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [November 24, 2011, 3:47pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/9 "2011-11-24T15:47:08Z")

</div>

> [@Jinx](#):
>
> Just wondering why our computer gods who gave us the internet could not use the conventional slash in a URL?

They did use the conventional slash. They were using unix machines. Those silly dos machines with their slashes going the wrong way came later.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [November 24, 2011, 3:51pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/10 "2011-11-24T15:51:37Z")

</div>

Browsers seem to be intelligent now to be able to properly interpret a URL entered with forward or back slash, so it’s no longer an issue.

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [November 24, 2011, 3:55pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/11 "2011-11-24T15:55:15Z")

</div>

> [@Jinx](#):
>
> Yes, the DOS **sintax** still lingers on in so many ways to hinder us.

A sintax is the money the government collects on wine, women, and song.

You’re thinking of syntax, which is when the women conjugate after wine and song.

---

<div class="post-metadata">

**Author:** ![Floater](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@Floater](https://boards.straightdope.com/u/Floater)\
**Post date:** [November 24, 2011, 4:00pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/12 "2011-11-24T16:00:34Z")

</div>

> [@Musicat](#):
>
> Browsers seem to be intelligent now to be able to properly interpret a URL entered with forward or back slash, so it’s no longer an issue.

So does my compiler.

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [November 24, 2011, 4:07pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/13 "2011-11-24T16:07:36Z")

</div>

> [@Floater](#):
>
> So does my compiler.

What compiler uses URLs?

---

<div class="post-metadata">

**Author:** ![Floater](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@Floater](https://boards.straightdope.com/u/Floater)\
**Post date:** [November 24, 2011, 4:10pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/14 "2011-11-24T16:10:07Z")

</div>

> [@psychonaut](#):
>
> What compiler uses URLs?

It doesn’t use URLs but DOS directories.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [November 24, 2011, 4:17pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/15 "2011-11-24T16:17:46Z")

</div>

> [@engineer\_comp\_geek](#):
>
> They did use the conventional slash. They were using unix machines. Those silly dos machines with their slashes going the wrong way came later.

But they did it because of something that came earlier - the forward slash was popular as a “command line switch” in old mainframe environments, and they carried that through into the DOS utilities. When they needed directory syntax, that created conflicts.

An explanation from Larry Osterman:

[http://blogs.msdn.com/b/larryosterman/archive/2005/06/24/432386.aspx](http://blogs.msdn.com/b/larryosterman/archive/2005/06/24/432386.aspx)

(If you ever had to deal with VMS file syntax, you could be no more than mildly annoyed by slashes that go the wrong way.)

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [November 24, 2011, 4:20pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/16 "2011-11-24T16:20:21Z")

</div>

> [@Musicat](#):
>
> Browsers seem to be intelligent now to be able to properly interpret a URL entered with forward or back slash, so it’s no longer an issue.

It’s not the browser, it’s the web server. The [http://boards.straightdope.com/](http://boards.straightdope.com/) part (aka the domain) gets you to a specific machine. Everything after that (the path) is interpreted by the web server on that machine. The domain by definition is not case sensitive. The path may or may not be case sensitive and may or may not accept forward or back slashes, depending on the machine and its particular web server software. Generally speaking, though, web servers are getting more flexible with what they support.

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [November 24, 2011, 4:31pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/17 "2011-11-24T16:31:34Z")

</div>

> [@yabob](#):
>
> (If you ever had to deal with VMS file syntax, you could be no more than mildly annoyed by slashes that go the wrong way.)

If you ever had to deal with RSX-11 numbered directories VMS was an improvement. 😛

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [November 24, 2011, 4:35pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/18 "2011-11-24T16:35:10Z")

</div>

> [@engineer\_comp\_geek](#):
>
> It’s not the browser, it’s the web server. The [http://boards.straightdope.com/](http://boards.straightdope.com/) part (aka the domain) gets you to a specific machine. Everything after that (the path) is interpreted by the web server on that machine. The domain by definition is not case sensitive. The path may or may not be case sensitive and may or may not accept forward or back slashes, depending on the machine and its particular web server software. Generally speaking, though, web servers are getting more flexible with what they support.

“depending on the machine” is a good point. The natural thing for the web server designer to do is simply parse out the file path between the domain spec and the “?” if present, slap the local doc root on the front of it, feed it to the native filesystem API, and you get what you get. Doing that naively in early webservers created some interesting security holes, for instance, allowing use of “..” to gain access to the directories above the doc root.

---

<div class="post-metadata">

**Author:** ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)\
**Post date:** [November 24, 2011, 4:42pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/19 "2011-11-24T16:42:00Z")

</div>

The / character is slash. The \ character is backslash. Dos/Windows is the one who does it backwards.

The use of \ by Dos/Windows is incredibly stupid. When writing programs, the \ character is used to indicate that the next character is special in some way. For example, I may put "  
" in the code to indicate a newline. Or " " to indicate a tab. The problem when writing code in Windows is that I have to backslash the backslash when I program paths into my code. For example, I have to do this:

path = “c:  
ew\ est”

I have to backslash the backslash. If I just had “c:  
ew est”, the compiler would turn the  
into a newline and the into a tab.

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [November 24, 2011, 5:03pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/20 "2011-11-24T17:03:18Z")

</div>

Yeah. SImple answer:  
Unix uses regular slashes, DOS used backslash.  
The original web service mimic’ed FTP and UNIX filesystems used the directory structure path to documents; since that’s how it was put on the disk/filesystem before active content.  
So basically, original browser was simply a file viewer that allowed you to put in the network name and filepath of whatever you wanted to open, not much different than a file reader like Notepad.  
No surprise then that the syntax for file(page) selection is basically network/unix syntax.  
The big leap of difference with http was adding the ability to code a section of that document so the browser would automatically follow that link whenit was selected.  
Adding active content - inputs, programming etc. was the gravy that gave us what we have today.

making changes to that would require a big shift.  
You can rewrite browsers so that they gues what you want without the punctuation; the “http://” has been optional for years.  
Until you are sure 90% of the people have browsers that follow the new standard, you can’t really rewrite the requirements for specifying HTML links. SO it stays that way due to poularity and inertia.

(It gets worse with new devices like smart phones; Microsoft can Apple can push out updates easily, but a lot of smart phones and other simple devices probably never get updated- so we’re stuck with what they work with, unless websites want to piss off their customers and drive them away.

Anyone remember how much fun it was when frames first appeared? Or 128-bit security certificates?

[Next page](https://boards.straightdope.com/t/urls-why-a-backslash/603971.md?page=2)
