Mobile app version of vmapp.org
Login or Join
Phylliss660

: Is it OK to have a case insensitive URI? If I have a URL like /writes/about/star-wars, and it is also accessible to users by /wRitEs/ABOUT/star-WARS, is that considered another page? Is a page

@Phylliss660

Posted in: #CanonicalUrl #CaseSensitive #Url

If I have a URL like /writes/about/star-wars, and it is also accessible to users by /wRitEs/ABOUT/star-WARS, is that considered another page? Is a page allowed to have any combo of upper/lower-case letters?

I know on Linux you can have my.file and My.FILE in the same folder so I was wondering if web pages work the same way. If so, I plan to stop supporting both paths and only allow the real one.

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

4 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

The best answer to your question really should cover two facets:

First: Whether or not the webserver should enforce a match on case.


When posed like that, it seems
obvious -- no. You want the user to
get land on the content, regardless
of the case requested.
Saying no, don't enforce case would
mean to allow case insensitivity.


Second: Given case insensitivity, how, then should you use case in your URIs?

The answer to the first facet of the question, IMO, is pretty obvious, and has already been discussed. You want to serve content, not error pages, so you should not configure your web server to enforce a matching case.

Then, the important considerations for the second facet of this topic would require consideration of SEO practices. The simplest answer would be to say, "BE CONSISTENT."

However, it's possible you have pages indexed by the SEs by different rules. One page or directory might have CamelCase, another has all lower case or Initialcapitalization. This is where to focus your energy...

First of all, decide upon a methodology.

Personally, I like everything to be all lower case. It bugs me sometimes when I see things like state codes (i.e. NY, FL, TX) in lower case, but it requires more effort on my part to have rules -- this is leading up to URL rewriting -- based on the specificity of the information conveyed by that part of the URI.

If you were to adopt the method of having everything as all lower case, then you can use a URL rewriter to rewrite URLs containing uppercase letters to lower case. There is a very important distinctions to make here:

Simply rewriting the mixed (or all UPPER) URI as an all lowercase URI does not provide the best possible solution. What you should do is actually 301-Redirect the URI to the proper style, not just rewrite it.

The 301-redirect should, in theory, decrease the percentage of URI requests that come in "incorrectly" because the 301 is telling the visitor (most importantly, SEs) to "update your records" so to speak.

People may debate upon all upper or all lowercase. Briefly, I'd suggest that all lowercase is a little easier to glance at and decipher, providing perhaps a little more readability than all uppercase. The reason for that is because lowercase letters have varying heights, some letters descend below the baseline (such as lowercase 'g'), some rise above the x-height (such as lowercase 'b'), or match the x-height (such as 'o'). In contrast, all CAPS tend to be more homogeneous in describing the space they occupy -- less variation means it requires a bit more effort to interpret, saying so lightly; you can't say the difference in effort is noticed.

Nevertheless, with all that said, my preference is to use all lowercase URIs in practice, and use a URL rewriter to rewrite (and redirect) the requests that do not conform.

10% popularity Vote Up Vote Down


 

@Angie530

Urls are case sensitive, but domains are not. It is not good practice to have them be case sensitive unless if you are using base64 url redirecting like bit.ly and tiny url.

If your site is on a windows server running IIS then it is likely case insensative to begin with. IIS cannot do case sensitives out of the box.

So, good practice is, using all lowercase urls.

10% popularity Vote Up Vote Down


 

@Reiling115

Domain names are case-insensitive. WEBAPPS.STACKEXCHANGE.COM is the same as webapps.stackexchange.com

Everything after the slash is up to the web server to handle. Depending on the web server software in use or the settings the server is using, that part of the URL may be case-sensitive or may be case-insensitve.

As ChrisF showed, the webapps.stackexchange.com server doesn't care what case is used. But this isn't always the case. For example, google.com/services is different from google.com/SERVICES. Or as another example, in a YouTube URL, the video ID (the v= part) is case sensitive.

As EricSchaefer pointed out, if you decide to allow case-insensitive URLs to return the same page, search engines may or may not recognize they're the same page. A search engine may notice the URLs are returning the same page and choose one version of the URL to show in the search results. Or it may not notice they're the same page, which might cause all versions of the URL to rank lower in the search results.

If you decide to allow case-insensitive URLs to return the same page, you may want to choose one version of the URL to be the "official" URL, and have all the other case-variants redirect to it using a 301 response header.
Or you may want to specify the "official" URL using a canonical meta tag. This way users can enter the URL using any case, but search engines will know the official URL to use for search results and ranking purposes.

10% popularity Vote Up Vote Down


 

@Si4351233

Usually it is not a good idea (SEO-wise) to have a resource be accessible by multiple URLs. Search engines regard /foo and /Foo as different URLs.

Yes, a page is allowed to have any combo of upper/lower-case letters.
But no, don't do it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme