Technical SEO · Glossary · Updated Apr 2026

Trailing slash

Definition

The trailing slash is the `/` character at the end of a URL path (`/about/` vs `/about`). To Google, the two forms are different URLs and can serve different content. Pick one canonical form site-wide and 301 the other. Mixing both produces duplicate-content signals and splits internal link equity.

Find related

Long definition

https://example.com/about and https://example.com/about/ are, by HTTP semantics, two distinct URLs. They may resolve to the same content, different content, or one might 404 — that's a server-config decision. Google treats them as separate URLs until told otherwise.

The historical convention: trailing slash for directories, no slash for files. /blog/ is a section, /blog/post-1 is a page. That distinction has eroded — most modern CMSs and frameworks pick one style and apply it everywhere. Both are valid; consistency is what matters.

Pick a form, then enforce it at three layers:

  1. Server-level 301 redirect from the non-canonical form to the canonical form. In Nginx: rewrite ^(.+)/$ $1 permanent; (strip) or rewrite ^([^.]*[^/])$ $1/ permanent; (add). Apache uses mod_rewrite rules with similar logic.
  2. Internal links — every <a href>, sitemap entry, and rel=canonical points to the canonical form. Inconsistent internal linking forces Googlebot to discover both, then redirect, wasting crawl budget on big sites.
  3. External campaigns — UTM links and ads use the canonical form to avoid an extra hop.

The homepage is the one URL where Google has stated it doesn't matter: https://example.com and https://example.com/ are treated as equivalent. Every other URL on the site needs the rule applied.

When you migrate from one form to the other, treat it as a site-wide URL change: prepare 301s, update sitemaps, monitor Search Console for crawl errors, expect a temporary dip in rankings while equity consolidates. Most sites recover within weeks.

Common misconceptions

  • "Trailing slash hurts SEO." Neither form is penalized. Inconsistency is what creates the problem — the same page reachable at two URLs splits signals.
  • "Google figures out the canonical form automatically." It will eventually, often picking the form that has more inbound links. But "eventually" is months, and during that window you lose ranking stability. Server-level redirects are immediate.
  • "It only matters for files vs directories." Modern routing rarely maps to the filesystem. Frameworks like Next.js, Laravel, and Django all let you pick a form for the whole app — what matters is consistency, not the historical file/directory split.
  • "A canonical tag fixes the problem." It helps signal intent, but it's a hint, not a directive. A 301 is the strong signal; canonical alone leaves both URLs crawlable and indexable as alternates.