Glossary
Trailing slash
A trailing slash is the `/` at the end of a URL path, and `https://example.com/about` and `https://example.com/about/` are two different URLs. Nothing in the standards makes either correct; what matters is that a site answers consistently. Serving the same content at both without redirecting creates a duplicate of every page, and mixing the two in internal links creates an unnecessary redirect on each one.
Why the two forms behave differently
A URL path is a sequence of segments, and a trailing slash denotes an empty final segment. That is a real difference in the string, and every component that compares URLs sees it.
Traditional web servers map paths to the filesystem: `/about` is a file, `/about/` is a directory whose index document is served. The convention of redirecting one to the other comes from there.
Relative link resolution differs. From `/docs/page`, a relative link to `guide` resolves to `/docs/guide`; from `/docs/page/` it resolves to `/docs/page/guide`. This is a genuine source of broken links.
The exception is the root: `https://example.com` and `https://example.com/` are the same URL, because an empty path is normalised to `/`.
What inconsistency costs
Two indexable URLs for one page, which splits inbound links and requires a canonical tag to resolve rather than being resolved by construction.
An extra redirect on every internal link written in the non-canonical form: a full round trip before the page begins to load.
Analytics reporting the same page as two rows, which makes traffic to it look smaller than it is.
Caches storing both forms separately, halving the hit rate for no benefit.
Choosing and enforcing one
Either convention is fine. Many static site generators produce directory-style URLs with a trailing slash; many application frameworks produce the other. Follow whichever your stack produces naturally.
Enforce it with a single server-level rule that redirects the other form with a 301, applied before the application sees the request.
Make internal links, canonical tags and sitemap entries all use the chosen form. A sitemap listing URLs that redirect is a small but entirely avoidable waste.
Do not apply the rule to URLs with file extensions. Redirecting `/style.css` to `/style.css/` breaks the asset.
How to check a site's behaviour
Request both forms of the same page and compare: `curl -sI https://example.com/about` and `curl -sI https://example.com/about/`. One should return 200 and the other a 301 to it.
If both return 200, the duplicate exists. Check whether the canonical tag at least points at one of them.
Check the canonical tag's own form matches the form that returns 200.
Sample several sections of the site. Rules applied in the application rather than at the server are often inconsistent between routes.
Frequently asked questions
- Does a trailing slash matter for SEO?
- The choice does not. The consistency does: serving the same page at both forms creates duplicate URLs that have to be resolved by a canonical tag or a redirect.
- Are example.com and example.com/ the same?
- Yes. An empty path is normalised to a single slash, so the root is the one case where the two forms are identical.
- Which form should I choose?
- Whichever your stack produces naturally. Then enforce it with one server-level redirect and use it in every internal link, canonical tag and sitemap entry.
Sources
Related
VeriFixScan crawls a site and applies its checks to every page it reaches, keeping the evidence behind each finding. Scanning one website is free.
Scan a website