Uppercase letters or underscores in URLs: how to fix them
Use lowercase letters and hyphens in every URL, and send the old versions to the new ones with 301 redirects. Mixed-case addresses can create duplicate pages or 404 errors, and underscores are a weaker choice than hyphens for separating words.
Some websites have addresses like /Services/Web_Design instead of /services/web-design. Visitors rarely notice, but search engines and web servers can treat the two very differently. This page explains what goes wrong, how to check your own site for free, and how to fix it without breaking links.
What the problem is and what people see
On most web servers, the path part of a URL (everything after the domain name) is case sensitive. The domain itself is not: Example.com and example.com are the same site. But /About-Us and /about-us can be two different addresses.
Depending on how your site is built, one of three things happens when someone uses the wrong capitalisation:
- Both versions load the same page, so search engines may see two copies of it.
- One version shows a 404 "page not found" error.
- One version redirects to the other (this is the healthy outcome).
Underscores are a separate, smaller issue. Google recommends hyphens to separate words in a URL, because it reads web-design as two words while web_design may be treated as one joined word. Underscores do not cause a penalty, they are just a less clear signal.
Why it matters
- Duplicate pages. If
/Pricingand/pricingboth work, links and visits get split between them. Google usually picks one version as the main one, but it may not pick the one you want. - Broken links and lost customers. Linux servers (the most common kind) are usually case sensitive. A link in an email, a printed leaflet or a social post with one wrong capital letter can land on an error page.
- Messy reports. Analytics can show the same page on two separate rows, so you under-count your best pages.
- Hidden until you move. Windows servers are often case insensitive, so the problem can stay invisible until the site moves to a different host or platform.
How to check your site (free)
- Click test. Open one of your pages, then change a few letters to capitals in the address bar and press Enter. Note whether it loads, redirects to the lowercase address, or shows an error.
- Look at your sitemap. Open
/sitemap.xml(the location varies) and scan for capital letters and underscores. - Google Search Console. In the Pages report, look for the reason "Duplicate, Google chose different canonical than user". In the Performance report you can usually filter pages with a custom regex such as
.*[A-Z].*for capitals or.*_.*for underscores. - Run a crawler. The free version of Screaming Frog SEO Spider crawls up to 500 URLs and has URL filters for uppercase characters and underscores.
- Let a review find it. SiteMonday's week 1 SEO review checks for this and lists it in the ranked fix list. It only finds and explains the problem: changing the URLs is up to you or your developer.
How to fix it in general
The steps are the same on every platform:
- Choose one rule: all lowercase, words separated by hyphens.
- List every URL that breaks the rule (your crawl export is ideal).
- Change each page's URL (often called the slug or handle) to the lowercase, hyphenated version.
- Add a 301 (permanent) redirect from each old URL to its new one, one to one. Do not send everything to the home page.
- Update internal links, menus, the sitemap and canonical tags so they use only the new URLs.
- Where your platform allows it, add one site-wide rule that redirects any capitalised URL to its lowercase version, and test it carefully first, because a faulty rule can cause redirect loops or break case-sensitive file paths.
One honest caution: if a page has ranked well for years and its only flaw is an underscore, weigh the benefit. A correct 301 redirect is safe, but every URL change carries a little risk. Uppercase duplicates should always be fixed. Underscores on important, established pages are a judgment call.
Common platforms
Menu names change between versions and themes, so treat these as where to look.
- WordPress: the structure is under Settings, Permalinks, and each page or post has its own slug in the editor sidebar. WordPress usually redirects an old post or page slug automatically after you change it, but test it. See the WordPress guide.
- Shopify: handles are normally lowercase already. You edit them under the "Search engine listing" section of a product or page, where there is usually a tickbox to create a redirect. Other redirects live under Online Store, Navigation, URL redirects. See the Shopify guide.
- Wix: the URL slug is in each page's SEO settings. Wix often adds a redirect when you change it, but confirm that it did.
- Apache: use
mod_rewriterules in.htaccessor the server config. A lowercase rewrite map needs the main server config, which shared hosting may not allow, so you may need explicit redirects. See the Apache guide. - Nginx, IIS and Next.js: Nginx uses
rewriteormaprules, IIS has an "Enforce lowercase URLs" template in the URL Rewrite module, and Next.js usesredirectsinnext.config.jsor middleware.
How to confirm the fix worked
- Visit an old, capitalised URL. You should land on the lowercase one.
- Check that it takes a single 301 redirect, not a chain. In a terminal you can run:
curl -I https://example.com/Old_Page
- Look for
301and alocation:line pointing at the new address. - Crawl the site again. The uppercase and underscore filters should now be empty.
- Confirm the sitemap lists only the new URLs, then resubmit it in Search Console. Old URLs can take weeks to drop out of search results, which is normal.
How to stop it coming back
- Write the rule down (lowercase, hyphens) and share it with anyone who publishes pages.
- Check the slug field before publishing, because many systems build it from the page title and may keep capitals or underscores you typed.
- Copy links from the live site rather than retyping them, and always link to the lowercase version.
- Keep the site-wide lowercase redirect in place permanently.
- Re-crawl after a redesign, a platform move or a bulk import, since those are the moments when old URL habits return.
Step by step for your platform
- Uppercase letters or underscores in URLs on WordPress
- Uppercase letters or underscores in URLs on Shopify
- Uppercase letters or underscores in URLs on Wix
- Uppercase letters or underscores in URLs on Apache
- Uppercase letters or underscores in URLs on Nginx
- Uppercase letters or underscores in URLs on IIS
- Uppercase letters or underscores in URLs on Next.js
Questions
Do uppercase letters in a URL hurt my Google ranking?
Not directly, but if the same page loads at two different capitalisations, Google may treat them as duplicates and split signals between them. A 301 redirect to one lowercase version avoids that.
Is the domain name case sensitive too?
No. `Example.com` and `example.com` always lead to the same site. Only the path after the domain, such as `/Contact`, is usually case sensitive.
Should I replace underscores with hyphens on every page?
For new pages, yes. For old pages that rank well, it is a judgment call: Google prefers hyphens, but any URL change carries some risk, so only do it with correct 301 redirects.
Will changing URLs make me lose my rankings?
A temporary dip is possible with any URL change, but correct one to one 301 redirects and updated internal links normally pass the page's value to the new address. Avoid redirect chains and never point everything at the home page.
Why does my site work with capitals on one host but not another?
Windows servers are often case insensitive, while most Linux servers are case sensitive. Moving hosts can suddenly turn capitalised links into 404 errors.
Can I fix this with a canonical tag instead of redirects?
A canonical tag is a hint, and it does not stop visitors landing on an error page or the wrong version. Redirects are the stronger fix, and a canonical tag works best as a backup.