Redirecting URLs

Update: I’ve updated this post based on the comments I’ve received about the .htaccess method causing server errors. I now recommend using the httpd.conf method (more details below).

Other than being annoying to geeks like me, there are plenty of reasons why you should redirect uppercase URLs to lowercase.

Domain names, such as, are not case-sensitive so you can display that however you’d like, whether it’s on the web or in marketing materials. Pages on your site however, such as this one,, work differently.

  • Case-sensitivity on Linux servers result in 404 errors
  • Google will consider upper and lowercase URLs different pages
  • Pages will show up as duplicates in analytics

Case sensitivity: Windows servers are normally not case-sensitive, but Windows servers typically cost more than Linux servers and do not have as many features as Linux, so most people choose to host their websites on Linux, which are case-sensitive. If you create a page on your site that has capital letters and someone tries to visit it with lowercase letters, they will see a 404 error page. This can also be a problem if the site goes through a redesign and all pages are changed to lowercase. All of those old URLs will become inaccessible and all of the links on the internet going to those pages will break. Many CMS’s like WordPress and Drupal will fix case sensitivity problems, even on a Linux server, in case you’re checkin’.

Google gets confused: Google sees non-www and www versions of a website as two different URLs and the same goes for uppercase and lowercase versions of the same page. This can spread page authority and link equity among the two pages when instead you should be sending it all to one page and giving it the ability to rank as highly as possible.

Analytics issues: I’m not sure how it works with other analytics programs, but in Google Analytics, I’ve heard that uppercase and lowercase versions of the same page show up separately, each with their own data. If you don’t think to look at data for both pages, you’re not getting an accurate representation of that page.

Arghh! Why Do People Create Uppercase URLs Anyway?

Capital letters in URLS
* image courtesy of CortneeB

There are actually several good reasons why someone might want capitalize page URLs.

  • Readability (Pay-Per-Click, print, or television)
  • Branding purposes
  • Some webmasters just think it looks better (ok, that’s not a good reason)

Readability and branding are the most common reasons that people display their URLs with capital letters. You’ll see it all the time in pay-per-click ads and instead of clicking the ads, some people might copy and paste the URL into their browsers. Branding is another big reason for capitalizing letters in URLs, especially when handing out print materials that have special landing pages.

For any of the above reasons, someone might visit your website by typing the URL with capitalization, or they might type it in lowercase, even if you’ve displayed it capitalized. People might link to your site both ways too, so you need to make sure both uppercase and lowercase versions are accessible.

Wipe Those Tears Away. Fixing Your URLs is Easy!

If you only have a few pages with capitalized URLs, you can simply set up some easy 301 redirects. If you have a ton of pages that need to be redirected though, you’ll probably find it much easier to implement a site-wide fix.

The preferred method is to use server config files. 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 might be willing to turn the feature on for you.

An alternative method is using the htaccess file, but depending on the Apache version your server is running on and any other rules already running in your htaccess file, this method can be buggy.

I’ve received several comments from people who say the code below doesn’t work on their server. I’ve tested it on my own sites with no issues, but my sites are fairly small. compiled a set of htaccess rules designed to change all uppercase URLs to lowercase URLs. On some servers, this can be break images or cause the site to suffer from decreased speed. Make sure your site is working properly after implementing this code before walking away from your computer.

I suggest setting up redirects for all of your sites, whether you have a URL problem or not, just as a handy catchall to prevent problems in the future.