Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question
1  
This question may be better suited for webmasters.stackexchange.com –  Bavi_H Nov 8 '10 at 5:36
add comment

migrated from webapps.stackexchange.com Nov 8 '10 at 6:09

This question came from our site for power users of web applications.

4 Answers

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.

share|improve this answer
    
If you allow case-insensitive URLs, always link to it by the 1 canonical URL. I would have thought that any variations in the case of the URL are likely to be typos of which there would hopefully be few. @Bavi_H On a server that allows case-insensitive URLs can you detect incorrect case URLs in order to do the 301 redirection, without actually first disabling case-insensitivity on the server? –  w3d Nov 8 '10 at 8:42
    
@w3d I only have a tiny bit of experience with a case-sensitive server. You'll have to refer to your web server's documentation to see how you can handle case variation in URLs. If 301 redirection isn't feasible, you can at least consider using the canonical meta tag as a way to tell search engines the preferred URL. –  Bavi_H Nov 9 '10 at 3:34
add comment

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.

share|improve this answer
2  
+1 The related specification is RFC 2616 Section 3.2.3 URI Comparison and it reads: "When comparing two URIs to decide if they match or not, a client SHOULD use a case-sensitive octet-by-octet comparison of the entire URIs" (though exceptions exist for hostnames) –  danlefree Nov 8 '10 at 6:27
    
I agree that having duplicate URLs is not a good thing when it comes to SEO, but you can mitigate that problem by specifying a canonical URL via the <link rel="canonical"> tag, as discussed here: googlewebmastercentral.blogspot.com/2009/02/… –  Scott Mitchell Nov 13 '10 at 0:23
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.