The Trailing Slash Guide is a community-maintained GitHub reference that documents how static site generators and hosting providers resolve URLs with and without trailing slashes, with live demos for each platform.
What is the Trailing Slash Guide?
The Trailing Slash Guide is an open-source repository, hosted at github.com/slorber/trailing-slash-guide, that serves as a practical reference for one of the most confusing parts of static hosting: whether /myPath and /myPath/ resolve to the same resource. It takes a small static site with files like file.html, folder/index.html, and both.html plus both/index.html, and deploys it to seven hosting platforms to record the exact HTTP behavior for every URL variant. The output is a set of Markdown docs and a side-by-side comparison table showing which combinations return 200, redirect, or 404.
The repo also explains the root causes: static site generators can emit either /myPath.html or /myPath/index.html, and hosting providers have no common standard for trailing slash handling. The guide lists both SSG-specific and host-specific behavior in separate docs, and closes with a solutions document.
Key Features
- Live behavior table — A comparison matrix covering GitHub Pages, Netlify (Pretty URLs on and off), Vercel (six
cleanUrls/trailingSlashconfigurations), Cloudflare Pages, Render, and Azure Static Web Apps, with clickable demo URLs for every cell. - Real deploy instances — Each host configuration has its own deployed site (e.g., vercel-cleanurls-false-trailingslash-true.vercel.app) so you can verify behavior yourself.
- SSG documentation — Separate Markdown docs describe how static site generators emit files, explaining why a path may resolve with or without a trailing slash.
- Solutions document — A dedicated doc suggests practical fixes for redirect, 404, and UX flicker issues.
- Problem categorization — The intro identifies three common failure modes: SEO/perf redirects, relative link 404s, and SPA router conflicts.
- Community maintained — The repository explicitly asks contributors to keep the matrix up to date and exhaustive.
Who should use the Trailing Slash Guide?
- Static site developers — Debug why a host redirects
/fileto/file/or returns a 404, and pick the URL scheme that matches your site's links. - SSG users — Understand whether your generator emits
file.htmlorfolder/index.html, and how that choice interacts with each host's defaults. - Platform engineers — Compare hosting provider behavior before choosing where to deploy, especially for SEO-sensitive projects or SPAs with client-side routing.
- Maintainers of docs sites — Avoid broken relative links by checking which URL forms are safe on your target host.
What can you do with the Trailing Slash Guide?
- Compare hosts quickly — Look up how GitHub Pages, Netlify, Vercel, Cloudflare Pages, Render, or Azure Static Web Apps will treat
/folderversus/folder/before deploying. - Reproduce issues — Click the live demo links to see each redirect or 404 in your own browser, using the provided static site as a test case.
- Apply a fix — Use the solutions doc to configure
cleanUrlsandtrailingSlashon Vercel, pretty URLs on Netlify, or to adjust your SSG's output format.
How does the Trailing Slash Guide work?
The repository is a reference rather than an automated tool. It defines a canonical static site with four file/folder combos, deploys that identical site to each host (with each host's relevant settings), and records the response for every URL. The results are compiled into Markdown tables, and each table cell links to the live URL so the behavior is independently verifiable.
FAQ
Is the Trailing Slash Guide free to use?
Yes. It is a public GitHub repository with no paywall, and the listed deployments are live for anyone to test. You can also fork the repo and run the same test against your own hosting setup.
Which hosting providers are covered?
The matrix currently covers GitHub Pages, Netlify with Pretty URLs on and off, Vercel with six combinations of cleanUrls and trailingSlash, Cloudflare Pages, Render, and Azure Static Web Apps. Each has live demo links.
What are the common trailing slash problems?
The guide lists three: SEO and performance issues from host redirects, 404 errors from relative links resolving differently with or without a trailing slash, and UX flicker when a host adds a trailing slash but a single-page-app router removes it.
Does the guide cover static site generator behavior?
Yes. There is a dedicated docs/Static-Site-Generators.md file that explains how generators emit file.html versus file/index.html, which is the root cause of many trailing slash inconsistencies.








