Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Structure: Lower case VS Upper case

Just trigger in my mind when I was going through some websites were they having upper case and lower case combination in url something like http://www.domain.com/Home/Article

Now as I know we should always use lowercase in url but have not idea about technical reason. I would like to learn from you expert to clear this concept why to use lowercase in url. What are the advantages and disadvantages for upper case url.

like image 299
Code Lover Avatar asked Nov 22 '12 10:11

Code Lover


People also ask

Does case matter in URL?

The cases of letters in a URL absolutely do matter to Google. Two URLs could look the same, and even lead to the same content, but they could be treated as different URLs if one has a capital letter and the other doesn't.

Should you use capital letters in URLs?

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.

Why are URLs lower case?

As a best practice, we recommend using only lowercase URLs on your website. It's simple, it covers all the bases, it's how most people type in URLs when visiting or linking to your site, and is the preferred “SEO-friendly” method.


1 Answers

The domain part is not case sensitive. GoOgLe.CoM works. You can add uppercase as you like, but normally there's not a reason to do so and, as stated in the comments below, may hurt your SEO ranking.

The path part is or is not case sensitive, depending on the server environment and server. Typically Windows machines are case insensitive, while Linux machines are case sensitive. This means that you should stick to lowercase or you risk introducing a bug that's really hard to hunt down (mismatched case that doesn't matter on the dev server).

The query string part is available to the server as it is. You can readily use mixed-case as you like, or discard the case (toLowerCase(...)). This also means that using a base64-encoded keys will work. You can't expect the users to type that correctly, though.

The hash part (called "fragment identifier") is only available to the client code, not to the server. Javascript may distinguish between the cases as it likes, and so does the browser. url#a will scroll to the element with the ID a, but url#A won't.

like image 178
John Dvorak Avatar answered Oct 03 '22 02:10

John Dvorak