URLs are case delicate – Tips on how to redirect uppercase letters to lowercase letters

0

Editor’s Note: This post was originally published on May 15, 2013 and has been updated for completeness and accuracy.

You might be surprised, but URLs are case-sensitive. If you have both uppercase and lowercase letters for your website’s domain, you can inadvertently make Google’s work more difficult – and affect your website’s performance.

If a page on your website is accessible in both upper and lower case, Google will treat each variation as a separate version. And that’s because these URLs can technically be unique versions. On Apache servers, you can display completely different content on URLs with the same page name if the page name has different cases (e.g. / case-sensitive vs. / case-sensitivity).

Like any other computer system, Google reads a line of text and treats uppercase and lowercase letters differently!

Mixing uppercase and lowercase URLs on your website isn’t always a problem as long as search engines can’t find both versions. However, to achieve this, some precautionary measures are required. Otherwise, you may experience a major headache later.

Here are some reasons why you should be case sensitive on your website.

  • Upper and lower case can result in 404 errors.
  • Search engines consider URLs in uppercase and lowercase letters to be different pages.
  • Search engines consider variations of the same page as duplicate content (more on this here).
  • Google may index the version of the URL that it doesn’t want to be indexed.
  • Pages are shown as duplicates in the analysis.

How different servers are case-sensitive

Windows servers are usually not case sensitive, so uppercase and lowercase URLs are usually not a problem there. However, these servers have some disadvantages. For one, Windows servers usually cost more than Linux servers. You also don’t have as much freedom as Linux servers, so most people choose to host their websites on Linux.

Linux servers are case-sensitive and this is where problems usually arise (more on this below).

Some popular ecommerce platforms (like Volusion and Shopify) allow URLs to be accessed in upper and lower case by default. You must therefore take additional steps to ensure that only one version is available and / or linked across the entire website. While this is not common, we sometimes see companies intentionally linking to uppercase letters from pages on their website in the main navigation, footers, or anywhere else on the website, even if the default is lowercase.

Why upper and lower case urls are important

Upper and lower case can cause 404 errors

If you create an uppercase page on a Linux server and someone tries to visit that lowercase page, the user will get a 404 error page (if there are no redirects).

This can happen when a link is forwarded through emails, newsletters, social media, and blog mentions. At some point someone might decide they don’t like the look of the uppercase letters and change them to lowercase without testing the URL. We see this all the time as we review the backlink data for our customers or their competitors.

This can also happen when a site is redesigned and a developer decides to change all pages from upper case to lower case. All of these old URLs may become inaccessible and any links on the internet that lead to these pages will be broken.

Many CMSs like WordPress and Drupal automatically fix case sensitivity issues on redirects, so this may not be a problem with your platform. However, always check to see if this is the case.

Google gets confused

Google sees non-WWW and WWW versions of a website as two different urls – and this also applies to upper and lower case letters on the same page. This can split page authority and the association of fairness across two pages if instead you should put everything on one page and give it a chance to rank as high as possible.

You can often check this in Google Analytics (GA) and Google Search Console (GSC). If GA is showing multiple versions of the same page that are getting traffic, those pages are likely to show up in search results, possibly with different rankings. In GSC you can check for which keywords each version has a ranking and how well they rank for these keywords.

Below is a real example. I can’t share the full url so all you have to do is trust me it’s the same page.

Google Analytics results for uppercase and lowercase letters on the same page show differences in the number of impressions

Chances are you’ll find a version that ranks better than the other for certain keywords. Both pages are canonical with the lowercase version, and the website has only been associated with the lowercase version for a few years. However, Google ignores the canons.

This is an example of why I believe canons are a good signal, but they are not reliable. I always recommend 301 redirects in this case.

It can even index the wrong page!

Even short-lived uppercase URLs can have permanent effects when Google indexes these pages.

Years ago, one of our customers made the mistake of linking to URLs in uppercase and lowercase letters on his website and in his sitemap. To this day, Google continues to index its URLs in capital letters, even after years of specifying lowercase letters and updating the XML sitemap.

Redirects can fix these issues most of the time (more on this below). However, since our customer’s platform does not allow this, Google continues to index a mixture of uppercase and lowercase letters on the website.

Analytics data issues

I’m not sure how it works with other analytics programs, but in Google Analytics, uppercase and lowercase letters on the same page are displayed separately, each with its own data.

Here is an example of the same page mentioned above:

Google Analytics results for uppercase and lowercase letters on the same page show differences in the number of users and sessions

If you don’t remember to view data for all versions of the same page, you won’t get an accurate representation of that page’s performance.

By the way, if you have this problem in GA, consider creating a new GA view that will filter all data in either uppercase or lowercase (depending on which version you want to use). Here’s a great guide that shows how to set that up.

With Inflow, we always leave an “unedited” raw view in our customers’ ATM accounts and then create a new, clean view with such filters.

Why do people create uppercase URLs in the first place?

Screaming girl with text: * Courtesy of CortneeB

Now that you know why uppercase letters are important in URLs, it clearly seems counterintuitive to use them.

However, there are several good reasons someone might want to capitalize Page URLs.

  • Readability (e.g. for pay-per-click, print or television advertising)
  • Branding purposes
  • Visual preference

Legibility and branding are the most common reasons for users to display their URLs in uppercase. We used to always see it in pay-per-click ads, but the search engines now automatically convert URLs in ads to lowercase. Branding is another major reason for capitalizing letters in URLs, especially when distributing printed materials with special landing pages or on social media.

For any of the reasons above, someone can visit your site by capitalizing the URL, or they can type it in lowercase even if you viewed it in uppercase. Users can also link to your website in both directions. So you need to either make sure that both uppercase and lowercase letters are available or that only one version is available and the other redirects.

How to redirect uppercase urls to lowercase

If you only have a few pages with capitalized URLs, you can just set up some simple 301 redirects. However, if you have a ton of pages to redirect, it’s likely a lot easier to implement a site-wide fix.

Option 1: Enforce lowercase URIs by rewriting them

The preferred method is to use server configuration files in your HTML. If you have access to your httpd.conf file, try this method. It’s clean and works well. If you don’t have access to your httpd.conf files, your hosting company may be willing to enable it for you.

Option 2: redirect access to lowercase letters

An alternative method is to use the htaccess file. Depending on the version of Apache that your server is running and other rules that are already running in your htaccess file, this method can be broken. On some servers, this can corrupt images or cause the site to slow down. We even received multiple comments from people who tried the htaccess method and received a status error of 500 across their entire website. We tested it on a few small websites and had no issues, but you have to be very careful with this method.

If you want to give it a try, AskApache.com has put together this set of htaccess rules. After implementing this code, make sure your site is working properly before you step away from your computer!

I recommend setting up redirects for all of your websites whether or not you have a url problem, just as a handy catch-all to avoid problems in the future. Preventing a problem now is much easier than trying to fix it later!

close

Don’t miss these tips!

We don’t spam! Read our privacy policy for more info.

Leave A Reply

Your email address will not be published.