How does the URL on YouTube videos know that the unique part of the URL is case-sensitive?

858 views

Whenever I go to YouTube or any website at all, it doesn’t matter if I write the website name in lowercase letters or uppercase letters, I will land on the same website. But whenever we go to a video and even replace 1 letter with lowercase or uppercase, the link doesn’t work.

How does the URL know that one section is not case-sensitive while the other section is case-sensitive?

I can understand why that’s the case. To keep the URLs unique. just in case something similar comes up. But what’s happening behind the scenes?

In: 52

22 Answers

Anonymous 0 Comments

Everything *before* the domain (.com, .org, .gov, etc.) is sent by the browser to, and is processed by, a domain name server (DNS) to provide the server’s IP address. The DNS server doesn’t care about upper or lower case because at the time it wasn’t considered necessary to distinguish.

Then the rest of the URL is sent by the browser to the server at that IP address, which looks at everything *after* the domain and figures out what to do with it. So /directoryname/pagename.html or /documentname.pdf or /imagename.jpg would tell the server to send a certain document. And if it’s something that starts with a question mark, usually it’s a set of variables that the server uses to decide what to do next.

So for YouTube, they’ve decided to use short strings of text that are case-sensitive to compactly designate the very large number of videos that are stored. Paying attention to case allows them to greatly increase the number of unique files that can be identified with those few characters.

You are viewing 1 out of 22 answers, click here to view all answers.