Deutsch
URLs & domains

URL case sensitivity

Also known as: URL case sensitive

URL case sensitivity describes whether uppercase and lowercase letters in a URL count as different. The scheme and host part ignore case, while the path and query are case-sensitive by definition.

How do upper and lower case affect URLs?

RFC 3986 states that scheme and host are case-insensitive and should be normalized to lowercase, so HTTP://www.EXAMPLE.com/ equals http://www.example.com/. All other parts of the generic syntax, including path and query, are case-sensitive unless a scheme defines otherwise. Whether /Shoes and /shoes return the same content is up to the server. Linux-based servers often treat them as different files, Windows-based servers often as the same (assessment).

Google treats URLs as case-sensitive. Its URL documentation says /APPLE and /apple are distinct URLs, and advises converting all text to one case if the server treats both the same. Google’s robots.txt documentation adds that path values in rules and the robots.txt file name itself are case-sensitive.

Example

Code
https://example.com/Shoes/   -> 200
https://example.com/shoes/   -> 200   (two URLs, same content)
https://EXAMPLE.com/shoes/   -> same URL as the line above

Common mistakes

  • Internal links, sitemaps and canonical tags use different capitalizations. Pick lowercase, redirect other variants with a 301 and use the same form in all links.
  • A robots.txt rule like Disallow: /Admin/ does not block /admin/.

FAQ

Can domains be case-sensitive? No. The host part of a URL is case-insensitive under RFC 3986.

Sources

  1. RFC 3986: URI Generic Syntax, 6.2.2.1 Case Normalization – IETFrfc-editor.org
  2. URL structure best practices for Google Search – Google Search Centraldevelopers.google.com
  3. How Google interprets the robots.txt specification – Google Search Centraldevelopers.google.com
  4. Google: URLs Are Case Sensitive – Search Engine Journal (secondary, Sep 28, 2021)searchenginejournal.com

Last updated: