13

I've visited many sites that most of them used lowercase in URLs like

stackoverflow.com/questions
google.com/webmaster
bing.com/news

Why using uppercase isn't more prevalent? Is there a problem using uppercase in URL? Is this a programming language problem?

Mohammad
  • 21,175
  • 15
  • 55
  • 84
  • 4
    It's just convention. Capital letters are commonly used in [Wikipedia](https://en.wikipedia.org./wiki/Wikipedia), [YouTube](https://www.youtube.com/user/YouTube) and [Twitter](https://twitter.com/Support) URLs if the article/channel/username has capital letters. All caps are rarely used because it's considered loud and harsh, but there is nothing technical preventing it. – that other guy Jul 14 '15 at 21:51
  • 2
    I've seen buggy bots convert URLs to lowercase. This caused a very special bug with code decompressing data encoded in the URL that wasn't validated, first. Some websites (notably reddit) use base-36 encoded IDs to avoid this. – David Ehrmann Jul 14 '15 at 22:07
  • Related question on [webmasters.se]: [Should my URLs be lowercase?](http://webmasters.stackexchange.com/q/51702/17633) – unor Jul 17 '15 at 21:42
  • Does this answer your question? [Should URL be case sensitive?](https://stackoverflow.com/questions/7996919/should-url-be-case-sensitive) – TylerH May 28 '21 at 13:59

2 Answers2

11

URLs are generally case-insensitive and lowercase is used only for stylistic purposes and so it doesn't look like URLs are yelling at you. You can still find uppercase letters in URLs. For example, Amazon product pages use numbers and uppercase letters for the product ID. You can change the letters to lowercase and the same page loads.

Josh Vazquez
  • 300
  • 1
  • 9
  • 2
    One more reason is to make the URL easy to remember. English had 26 alphabets but when you consider small and capital case distinct it grows to 52. – Pranav Waila May 06 '16 at 05:49
  • 1
    I think that's because Amazon are searching by upper and lower case for their products IDs – Ikdemm Nov 05 '21 at 10:44
8

URLs are not case sensitive up to a point.

A URL of Foo.Bar will be treated the same as foo.bar and FOO.BAR. However, if a URL contains characters of a different case after the domain (.bar in my example), it is possible that changing the case of those characters will result in an error.

So, if a URL is provided as foo.bar/Baz, and you try to access foo.bar/baz, you risk accessing the wrong resource or encountering an error.

Remember that URLs with forward slash characters following the domain (as in foo.bar/baz) are treated (at least on the front end) as pointers to directories in a file system, and case sensitivity will be dependent on the file system the web server is using.

Pete
  • 391
  • 1
  • 8
  • 20
  • Interesting, so we should care about SEO - page duplicates can happen on urls which differs only with case of letters... – Parks Jun 28 '21 at 08:28