Mobile app version of vmapp.org
Login or Join
Tiffany637

: Should URL paths be case sensitive? My website's URLs are currently case-insensitive. For example, both of the following links show the exact same page: http://example.com/about http://example.com/About

@Tiffany637

Posted in: #CanonicalUrl #CaseSensitive #DuplicateContent #Google #Url

My website's URLs are currently case-insensitive. For example, both of the following links show the exact same page:

example.com/about http://example.com/About


However, taking a look at the wordpress.org website, I noticed that URLs are case-sensitive. For example, the second link below is a 404 error page:

wordpress.org/about http://wordpress.org/About


My thoughts are to make my website's URLs case sensitive. Aside from the obvious issue of avoiding duplicate content, what are the pros and cons of having case-sensitive URLs?

Update

Google seems to operate a case-sensitive URL policy on their own URLs. For example, the second link below is a 404:

google.com/doodles http://google.com/Doodles


Update 2

Thanks for your answers. I decided to take the advice mentioned in the accepted answer and implement 301 redirects where necessary. Since I'm working with WordPress, my code solution is as follows (in case anyone is interested):

function force_lowercase_urls() {

if ( is_admin() )
return;

if ( preg_match( '/[A-Z]/', $_SERVER['REQUEST_URI'] ) ) {

wp_redirect( strtolower( $_SERVER['REQUEST_URI'] ), 301 );
exit();
}

}
add_action( 'init', 'force_lowercase_urls' );

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

3 Comments

Sorted by latest first Latest Oldest Best

 

@Miguel251

Here is Google's position from an archived live chat session (the link is now dead):


*Does inconsistent capitalization of URLs cause duplicate content issues and dilution of page rank? For example site.com/abc vs
site.com/Abc. On Windows hosts, these are the same page, but are
different pages on Unix hosts.

JohnMu: Hi John, based on the existing standards, URLs are
case-sensitive, so yes, these would be seen as separate URLs. Since
the content on the URLs is the same, we'll generally recognize that
and only keep one of them. However, we'd recommend that you try to
keep all links going to one version of the URL. Keep in mind that this
also applies to robots.txt files.*


The IE Team recommends picking a file casing convention and adhering to it strictly as it can improve performance.

10% popularity Vote Up Vote Down


 

@Heady270

Two of the most widely used operating system file systems for serving web content have have very different settings for case sensitivity of URLs by default. Whether or not your URLs are case sensitive is likely a function of which you are using:


Microsoft IIS running on Windows - case insensitive URLs - shows the same content regardless of capitalization.
Apache HTTPD Server running on Linux - case sensitive URLs - gives a 404 not found error for incorrect capitalization.


In my opinion, neither default is ideal:


Showing the same content regardless of capitalization makes crawling your web site harder. Search engines consider the same content on multiple URLs to be duplicate content.
Showing error pages for incorrect capitalization is not user friendly. Users are not usually mindful of capitalization when they type.


The ideal solution would be to show the page only when the URL is correctly capitalized. For incorrect capitalization, the user should be 301 redirected to the preferred capitalization. There are some ways that this can be accomplished:


For Apache, mod_speling can be enabled which will do the case insensitive redirects.
For Apache, a mod_rewrite rule can force all URLs to be lowercase.
For IIS, a rule can be added to force all URLs to be lowercase

10% popularity Vote Up Vote Down


 

@Lee4591628

RFC 3986 6.2.2.1 defines URIs as case-insensitive, so it is not a good idea to make them case-sensitive like wordpress.org does.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme