SEO

Trailing Slash

Also called URL slash, slash consistency

The slash at the end of a path, whose presence or absence makes two technically different addresses for one page.

Quick facts: Trailing Slash

Category
SEO
Also called
URL slash, slash consistency
Level
Beginner
Affects
Duplicate URLs, analytics accuracy, redirect chains
Where to see it
Screaming Frog, browser network tab, GA4 page path report
In this article4
  1. How the trailing slash works
  2. Why the trailing slash matters
  3. Where the trailing slash goes wrong
  4. Getting it right

How the trailing slash works

A trailing slash is the mark at the end of a URL path: the difference between an address ending in the word contact and one ending in contact followed by a slash. To a server and to a search engine those are two different addresses. Whether they both return a page, and whether they return the same page, depends entirely on how the site is configured.

The convention came from the days when a path with a slash meant a directory and a path without one meant a file. Modern platforms have made it a style choice instead. WordPress adds the slash when the permalink structure ends in one; several static hosts and JavaScript frameworks default to leaving it off. Neither is better for rankings. The only thing that matters is that a site picks one and never contradicts itself.

One address always keeps its slash: the home page. A bare domain resolves to a single slash whatever style the rest of the site uses, which is why home page URLs look inconsistent with the pattern below them.

Why the trailing slash matters

If both forms return a page with a success status, the site has two copies of everything. Links and shares land on whichever version somebody happened to copy, so the signals split. Analytics reports the same page twice, once in each form, and every report that ranks pages by traffic understates both.

There is a subtler effect worth knowing. Relative links are resolved against the current address, and the slash changes what the browser treats as the current folder. A relative link written on a page without a slash can resolve to a different destination than the identical link on the same page with one, which is how sites end up with images that load in one form of a URL and break in the other.

Where the trailing slash goes wrong

The common failure is a redesign that quietly flips the default. Every existing address changes form, nothing redirects, and the site starts again with new URLs while the old ones return errors. The second is applying the rule too broadly — a redirect that adds a slash to everything will happily do it to files with extensions, breaking a sitemap or a feed.

The third is stacking rules until they chain. A request that is redirected from plain to secure, then from one hostname to another, then to add a slash, has made several hops before anything is served. Each hop costs time and slightly weakens the link.

Getting it right

Choose the form the site already uses and the one most of your existing links point at, then enforce it once, at the server, in a single hop. Make everything else agree: canonical tags, the XML sitemap, internal links in templates and content, hreflang if you have it, and the final URLs in your ad accounts.

Verify with a crawl rather than by eye. Request a handful of pages in the wrong form and confirm each one redirects straight to the right form with no intermediate stop. Then check your analytics for pages appearing in both shapes, which is the quickest sign that something is still generating the wrong style. It is a small piece of technical SEO that sits next to canonical tags and avoiding a redirect chain.

Do and do not

Do

  • Pick the form your existing links already use
  • Enforce it in a single server redirect, one hop
  • Match canonicals, sitemap, internal links and ad final URLs

Do not

  • Switch style during a redesign without redirects
  • Add a slash to files with extensions
  • Stack protocol, hostname and slash rules into a chain

Questions people ask about this

Does a trailing slash affect rankings?

The choice itself does not. Search engines have no preference between the two styles. What does affect rankings is inconsistency: if both forms serve the same page, links and other signals divide between two addresses instead of accumulating on one. Pick either style, redirect the other form to it, and make sure your canonicals and sitemap agree.

Should I change my site to the other style?

Usually not. Switching means every URL on the site changes, every old address needs a permanent redirect, and every internal link, canonical and sitemap entry has to be rewritten. That is real risk for no gain, because neither form ranks better. Only change if your platform forces it, and treat it as a migration with proper redirects.

Why does my home page have a slash when nothing else does?

Because the root of a domain is a special case. A bare domain name always resolves to a single slash, and browsers add it whether or not you type it. That is expected behaviour, not an inconsistency to fix, and it applies to every site regardless of which style the rest of the pages use.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.