Google treats /page and /page/ equally, but as two URLs. Pick one, redirect the other and use it everywhere. Settings for Next.js, Vercel and Netlify.
LLaunchScaler·Published ·8 min read
A trailing slash does not help or hurt rankings: Google treats /pricing and /pricing/ equally. What matters is that they are two different URLs, so a site that serves both with a 200 gives Google two copies of every page to choose between. Pick one form, 301 or 308 the other to it, and use the chosen form in every canonical tag, sitemap entry and internal link.
The root of the domain is the one exception, and each common host has its own setting that does the redirect for you.
Does a trailing slash matter for SEO?
The choice does not matter; the consistency does. Google's own post on the question says it treats each URL "separately (and equally)" whether or not it ends in a slash. So /pricing and /pricing/ are two URLs to Google, neither ranks better, and serving both splits your signals across two addresses.
When both forms return a 200 with the same content, Google clusters them as duplicates and picks one as canonical. It may pick the form you don't use in your links, and the Page indexing report fills with "Duplicate without user-selected canonical" or "Alternate page with proper canonical tag" rows. Google's post calls this legitimate and says its indexing "often handles this case", but it also recommends fixing it "to reduce duplicate content and improve crawl efficiency."
Your setup
What Google sees
Result
One form 200, the other 301 or 308 to it
One URL per page
Clean. Google says results will likely show the form that returns 200.
Questions, answered
What people ask about this
01
Does a trailing slash matter for SEO?
Which form you choose does not matter; Google treats a URL with a slash and without one equally. Serving both forms with a 200 does, because Google sees two URLs with the same content and has to pick one.
Usually fine; the canonical is a strong signal but not a redirect.
Both forms 200, no canonical
Two duplicate URLs
Google picks a canonical for you.
Chosen form redirects to the other, and back
A loop
Neither form can be crawled.
Is the root URL an exception?
Yes. For the root of a domain, https://example.com and https://example.com/ are the same URL. Google's post says the root "is equivalent to https://example.com/ and can't be redirected." So for the homepage there is nothing to choose and nothing to fix.
The question starts one level down. https://example.com/pricing and https://example.com/pricing/ are distinct, and so are /blog/post and /blog/post/. Files are treated differently too: Next.js and Vercel both leave paths with a file extension, such as /robots.txt or /image.png, unredirected even when trailing slashes are turned on.
Which should you choose: with or without a slash?
Choose the form your framework or host produces by default, unless you already have indexed URLs in the other form. Google says it's "more conventional to use a trailing slash" for directory-style URLs, "but you can choose whichever you like." Matching the default means fewer overrides and fewer chances for one layer to fight another.
Whatever your location and try_files rules produce
An explicit redirect rule
If your site already ranks, keep the form Google currently shows. Check it with a site:yourdomain.com search or the Performance report's Pages tab, and standardize on that. Switching an established site means every indexed URL moves through a redirect, which works but gains nothing.
How do you make one form canonical?
Serve one form with a 200, redirect the other permanently, and then make every signal agree: the canonical tag, the sitemap and your internal links. Google's post lists the same steps: choose a preferred version, use it in internal links and the sitemap, and 301 the duplicate to it, with rel="canonical" as the fallback when a redirect isn't possible.
Decide the form, for example no trailing slash.
Redirect the other form with a 301 or 308. Google treats both codes as permanent and uses them as a signal that the target should be canonical.
Write every <link rel="canonical"> in the chosen form: https://example.com/pricing, never https://example.com/pricing/.
Generate the sitemap in the same form, so each <loc> returns a 200 without redirecting.
Fix internal links, including navigation, footer and in-body links, so crawlers never have to take the redirect. Google's canonical documentation asks you to link to the canonical URL rather than a duplicate.
Check that the redirect goes straight to the final URL in one hop, not through an http:// or www step first.
A canonical tag and a sitemap that disagree about the slash are two conflicting signals, and Google may resolve them in a way you did not intend. The canonical tag mistakes guide covers that and the other ways a canonical gets ignored.
How do you set it in Next.js, Vercel, Netlify and Nginx?
Every major host has one setting that issues the redirect for you. Next.js redirects /about/ to /about by default and flips with trailingSlash: true. Vercel's vercel.json has its own trailingSlash key that answers with a 308. Netlify's Pretty URLs adds the slash. On Nginx you write the rule yourself.
Next.js, in next.config.js:
module.exports = {
trailingSlash: true, // /about now redirects to /about/
}
Without the key, Next.js redirects /about/ to /about as a permanent redirect, which Next.js sends as a 308. With it, /about redirects to /about/, except static files with an extension and paths under .well-known/. One setting disables this: skipTrailingSlashRedirect: true, which some analytics proxies ask for, turns the redirect off entirely, so both forms return 200. If you need it, keep a self-referencing canonical on every page so Google still gets one preferred URL.
Vercel, in vercel.json for a project that is not handling this in its framework:
{
"trailingSlash": false
}
Vercel's docs say false answers a path ending in a slash with a 308 to the path without it, true does the reverse (files with an extension are left alone), and leaving the key undefined serves both forms without redirecting, which the docs themselves say "is not recommended because it could lead to search engines indexing two different pages with duplicate content."
Netlify handles it differently. Its docs say you "cannot use a redirect rule to add or remove a trailing slash", because its CDN normalizes the slash before redirect rules run, so /blog/old and /blog/old/ match the same rule. The control is Pretty URLs, enabled by default, which forwards /about to /about/ and rewrites /about.html to /about/. Check it under Project configuration > Developer settings > Post processing > Pretty URLs.
Nginx, to remove the slash with a permanent redirect (the permanent flag returns a 301):
rewrite ^/(.+)/$ /$1 permanent;
Put it in the server block, and exclude real directories your app serves from disk if any exist.
How do you check it with curl?
Request both forms without following redirects and read the status line and location header. The form you chose should answer 200. The other should answer 301 or 308, with a location that points at the chosen form in one hop. A 200 on both means you are serving duplicates.
curl -sI https://example.com/pricing | head -n 3
curl -sI https://example.com/pricing/ | head -n 3
A correct no-slash setup looks like this for the second request:
HTTP/2 308
location: /pricing
Check a few URL types, not just one: a top-level page, a nested page such as /blog/some-post, a URL with a query string, and a file such as /robots.txt. Then check the other hosts and protocols too, because http://www.example.com/pricing/ should reach https://example.com/pricing in a single redirect. The redirect chains and loops guide shows how to trace a URL hop by hop, and the www vs non-www guide covers combining the host redirect with the slash redirect so they don't stack.
What does Search Console show when it's wrong?
The redirected form shows up in the Page indexing report under "Page with redirect", which is expected and needs no action once internal links and the sitemap stop using it. Both forms returning 200 shows up as duplicate rows, and a loop shows up as "Redirect error".
Add the redirect, or at least a self-referencing canonical.
Alternate page with proper canonical tag
Both forms return 200, and the canonical names one
Fine, but a redirect is cleaner.
Redirect error
A loop between the two forms, often two layers disagreeing
Remove one of the two rules.
A loop usually means two layers each enforce a different form: the framework removes the slash while the host or CDN adds it back. Pick one layer to own the rule and turn it off in the other.
Check your redirects and canonicals together
The slash is one of several URL variants that should all collapse onto one address. Run the free scan on LaunchScaler with just your address and no account: it runs 156 checks across 6 of its 7 categories, and its search checks follow the redirects from the URL you give it and flag a chain with more than one hop, read the canonical tag and flag one that is missing or points to a redirected URL, and check that your sitemap lists only canonical URLs that return 200.
No. The root URL is the exception: Google says https://example.com is equivalent to https://example.com/ and cannot be redirected. The slash question only applies to paths below the root.
03
Should I use a 301 or a 308 for trailing slash redirects?
Either. Google treats both as permanent redirects and uses them as a signal that the target should be canonical. Next.js and Vercel use 308 by default.
04
Should URLs end with a trailing slash?
Google leaves it to you. Its old guidance notes that a trailing slash is conventional for directory-style URLs, but either works as long as one form is served and the other redirects to it.
05
How do I check if my site handles trailing slashes correctly?
Request both forms with curl -I. The form you chose should return 200, and the other should return 301 or 308 with a Location header pointing at the chosen form.
'URL is not on Google' means the page can't appear in Search. The Page indexing lines below it name the blocker: discovery, crawl, noindex or canonical.
Check WordPress in this order: the Discourage search engines box, SEO plugin noindex settings, one sitemap, coming-soon mode, firewalls, then cached pages.