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
The domain of the website is used by DNS to look up which server that website is at. DNS is case insensitive. All domains are converted to lower case before the lookup takes place. The rest of the URL is used by HTTP to identify the resource at the website you want to get. And HTTP is case sensitive. It is up to the webserver if they want to convert this part to lower case or not, some do and some do not. In the case of YouTube they use the case of the characters to further identify exactly which video you want to watch. So their URLs are case sensitive.
The domain of the website is used by DNS to look up which server that website is at. DNS is case insensitive. All domains are converted to lower case before the lookup takes place. The rest of the URL is used by HTTP to identify the resource at the website you want to get. And HTTP is case sensitive. It is up to the webserver if they want to convert this part to lower case or not, some do and some do not. In the case of YouTube they use the case of the characters to further identify exactly which video you want to watch. So their URLs are case sensitive.
Youtube doesn’t use the URL directly to link to the video, but URL parameters. This is recognizable at the **?** at the of the URL.
Afterwards, you have the name of the parameter, and its value, e.g. v=1_Z5q152GSQ
This is a way to make dynamic webistes, regarding information you put in in the previous site.
This parameter isnt part of the site adress, but an addition to it and therefore ~~not~~ case sensetive
Edit: The Parameter of course is case sensetive. (In this instance. What the server does with the parameter, is up to the server. If he doesnt treat it as case sensetive, its not case sensetive.
Youtube doesn’t use the URL directly to link to the video, but URL parameters. This is recognizable at the **?** at the of the URL.
Afterwards, you have the name of the parameter, and its value, e.g. v=1_Z5q152GSQ
This is a way to make dynamic webistes, regarding information you put in in the previous site.
This parameter isnt part of the site adress, but an addition to it and therefore ~~not~~ case sensetive
Edit: The Parameter of course is case sensetive. (In this instance. What the server does with the parameter, is up to the server. If he doesnt treat it as case sensetive, its not case sensetive.
The domain part of the website (e.g. YouTube.com) is case insensitive, which means it doesn’t matter if it’s lower or uppercase, just think that it is all turned into lower case.
The domain part is just used to figure out what computer on the internet to send your message to, which would be a server at YouTube.
The bit after this, e.g “watch”, or the video ID is not used until later on in the process. This part of the URL will be processed by the YouTube server and systems. Here it is case sensitive.
YouTube will store the video ID in a database somewhere and needs to search for it to retrieve the video. Here it matters that the upper/lower cases match, because it allows them to store a lot more IDs (more unique combinations).
The domain part of the website (e.g. YouTube.com) is case insensitive, which means it doesn’t matter if it’s lower or uppercase, just think that it is all turned into lower case.
The domain part is just used to figure out what computer on the internet to send your message to, which would be a server at YouTube.
The bit after this, e.g “watch”, or the video ID is not used until later on in the process. This part of the URL will be processed by the YouTube server and systems. Here it is case sensitive.
YouTube will store the video ID in a database somewhere and needs to search for it to retrieve the video. Here it matters that the upper/lower cases match, because it allows them to store a lot more IDs (more unique combinations).
URLs in general are case-sensitive, but most web-servers treat upper and lowercase letters the same. There is however no requirement for them to do so.
Generally it makes sense to handle anything a user might type in so that case doesn’t matter, with things like YouTube IDs wehre you want to cram as much information as possible into as short a string as possible and which usually just get copied and pasted not typed in this can justifiably ignored. (YouTube uses a modified BASE64 encoding for the ID, where each character can be one of 64 different possibilities)
It should be noted that DNS (the part of the URL that ends in .com or similar) is always case insensitive. The stuff that follows after original was just a path and file in the filesystem of the webserver, so if your webserver was running on an OS that had case sensitive filenames you also had case sensitive URLs unless you told the webserver to automatically translate everything to one case and were careful not to have two files with the same name when ignoring case.
Generally you as the one who sends in the URL to the server should always treat case as if it matters and the webserver (unless they have a good reason like youtube) should treat it as if it didn’t matter.
URLs in general are case-sensitive, but most web-servers treat upper and lowercase letters the same. There is however no requirement for them to do so.
Generally it makes sense to handle anything a user might type in so that case doesn’t matter, with things like YouTube IDs wehre you want to cram as much information as possible into as short a string as possible and which usually just get copied and pasted not typed in this can justifiably ignored. (YouTube uses a modified BASE64 encoding for the ID, where each character can be one of 64 different possibilities)
It should be noted that DNS (the part of the URL that ends in .com or similar) is always case insensitive. The stuff that follows after original was just a path and file in the filesystem of the webserver, so if your webserver was running on an OS that had case sensitive filenames you also had case sensitive URLs unless you told the webserver to automatically translate everything to one case and were careful not to have two files with the same name when ignoring case.
Generally you as the one who sends in the URL to the server should always treat case as if it matters and the webserver (unless they have a good reason like youtube) should treat it as if it didn’t matter.
The domain name is never case sensitive so [www.reddit.com](http://www.reddit.com) and WwW.RedDit.cOm and any other variant work the same way.
After the domain name and the / all the information is interpreted by the web server exactly how it is done will depend on how the website was built. The developers could have made the video ID so the case does not matter but they did not. The reason is in all likelihood that it gives you more possible identifiers with the same identifier length.
The developers of Reddit did not make the same choice so https://www.reddit.com/r/explainlikeimfive/comments/17eeu1y/ and https://www.reddit.com/r/explainlikeimfive/comments/17EEU1Y/ both tive yoy this thread. The end part “eli5_how_does_the_url_on_youtube_videos_know_that/” is not required
The developers just did it diffrently
So they know that the domain name part is always case-insensitive. They know how the rest works because you developed the website and dedicated how it works.
That all after the / is up to the developers is a bit of a simplification Look at [https://youtu.be/AiOUojVd6xQ?t=681](https://youtu.be/AiOUojVd6xQ?t=681)the ? is there to show the rest is a query and the variable t gets the value 681. What that man it up to the website it this chase it time = 681 seconds so you do not start int eh beginning of the video
The domain name is never case sensitive so [www.reddit.com](http://www.reddit.com) and WwW.RedDit.cOm and any other variant work the same way.
After the domain name and the / all the information is interpreted by the web server exactly how it is done will depend on how the website was built. The developers could have made the video ID so the case does not matter but they did not. The reason is in all likelihood that it gives you more possible identifiers with the same identifier length.
The developers of Reddit did not make the same choice so https://www.reddit.com/r/explainlikeimfive/comments/17eeu1y/ and https://www.reddit.com/r/explainlikeimfive/comments/17EEU1Y/ both tive yoy this thread. The end part “eli5_how_does_the_url_on_youtube_videos_know_that/” is not required
The developers just did it diffrently
So they know that the domain name part is always case-insensitive. They know how the rest works because you developed the website and dedicated how it works.
That all after the / is up to the developers is a bit of a simplification Look at [https://youtu.be/AiOUojVd6xQ?t=681](https://youtu.be/AiOUojVd6xQ?t=681)the ? is there to show the rest is a query and the variable t gets the value 681. What that man it up to the website it this chase it time = 681 seconds so you do not start int eh beginning of the video
Latest Answers