Automated technical SEO checks that catch indexing blocks and deploy regressions — seotto.com

Few URL questions generate as much quiet frustration as this one. example.com/pricing or example.com/pricing/?

To search engines, those are two different URLs. They can return different content, carry different canonical tags, and get crawled and indexed separately. Frameworks pick different defaults. Static hosts sometimes add a redirect you didn't configure. And every team that has migrated between frameworks has a story about a few thousand redirects that appeared overnight.

Nearly everyone agrees on the minimum: pick one form and make the other redirect to it. The argument is about which one, so let's have it.

The case for trailing slashes

It matches how static files work. On a static host, /pricing/ maps naturally to /pricing/index.html. Many static site generators produce exactly that directory structure, and servers like Nginx and Apache add the slash automatically when you request a directory without one. Using slashes everywhere matches what the server does anyway.

Relative links behave predictably. On /docs/install/, a relative link to config resolves to /docs/install/config. On /docs/install (no slash), the same link resolves to /docs/config. Sites that use relative links internally, especially documentation, get fewer surprises with slashes.

It signals "this is a section". /blog/ reads as a collection that contains things; /blog/my-post/ as a page in it. Some people find that hierarchy easier to reason about.

It's the default in several popular tools. Hugo and many other static site generators, WordPress (with typical permalink settings) and plenty of hosting platforms default to slashes.

The case against

It's how most people type and share URLs. Nobody types the trailing slash. Links in emails, chat and social posts usually omit it. Without a slash, the URL people type is the canonical URL, and no redirect is needed for most incoming traffic.

It looks like a file path for pages that aren't directories. /pricing is a page, not a folder. For apps where URLs are routes rather than files, the slash is a leftover from the static file era.

It's the default in several other popular tools. Next.js defaults to no trailing slash, as do many application frameworks and routers. If your stack defaults that way, fighting it adds configuration for no clear benefit.

Files and API endpoints never have it. /feed.xml, /sitemap.xml and /api/users don't end with slashes. A no-slash convention is consistent across pages, files and endpoints.

What actually matters for SEO

Either form is fine for search engines. What causes problems is inconsistency:

  1. Both versions returning 200. Then you have duplicate URLs, split link signals, and crawlers fetching everything twice. One form must redirect (301 or 308) to the other.
  2. Internal links using the non-canonical form. Every internal link that hits the redirect costs an extra request, for crawlers and users. Links, canonicals, sitemaps and hreflang should all use the canonical form directly.
  3. Canonicals that disagree with the redirect. A page at /pricing/ with a canonical tag pointing to /pricing, while /pricing redirects to /pricing/, is a loop of mixed signals.
  4. Redirect chains after a migration. Moving from a slash framework to a no-slash one (or the reverse) on top of an HTTP-to-HTTPS redirect and a www redirect can produce three hops for old links. Collapse them into one.

Slash rules only work if every URL actually follows them. seotto.com checks for canonical and redirect inconsistencies, including trailing-slash mismatches.

Where I've landed

I lean towards no trailing slash for application-style sites and slashes for content sites built from static files, but honestly the right choice is whichever your framework and host do by default. Fighting your stack's default is a recurring source of bugs: a config change in one layer, a redirect rule in another, and a host that adds its own behaviour on top.

Whatever you choose:

  • Configure it in exactly one place, and make sure the other layers don't add their own redirects.
  • Check it with curl, for a page, a nested page, a URL with a query string, and the root:
for u in /pricing /pricing/ /docs/install /docs/install/ "/pricing?ref=x"; do printf '%-22s ' "$u"; curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' "https://example.com$u" done 

Exactly one of each pair should return 200; the other should redirect to it in a single hop, keeping the query string.

  • Make your sitemap, canonicals and internal links use the canonical form, and check them after every framework upgrade.

Catching duplicate URL forms and redirect chains like these is one of the routine checks we run at seotto.com.

Where the setting lives in common stacks

Part of the confusion is that the setting lives in different places. In Next.js it's the trailingSlash option in next.config.js. In Hugo, the uglyURLs setting and your content structure decide it. In Astro, it's the trailingSlash config option, with build.format deciding the file layout. In Nginx, requests for a directory without the slash get a 301 automatically, and try_files rules decide the rest. On static hosts such as Netlify, Cloudflare Pages and Vercel, there's often a separate "pretty URLs" or trailing slash setting that applies on top of your framework's output. Check every layer; two layers disagreeing is how redirect loops happen.

The edge cases

  • The root. example.com and example.com/ are the same URL to HTTP clients, so you can't redirect between them. No debate needed here.
  • File-like paths. If you use slashes, does /feed.xml/ get a slash? (Please, no.)
  • Migrating an established site. If your current form is consistent and indexed, is switching ever worth thousands of redirects? I'd say almost never, but some teams do it for framework consistency.

Related reading

So: trailing slash or not? And has your framework ever made the decision for you in a way you didn't notice until the redirects appeared?