Guide · Redirects

Is a 307 on trailing slashes bad for SEO? How to choose between 301, 302, 307 and 308

Updated 2026-11-10 · kagentx

Short answer

Cloudflare static assets by default add the trailing slash to URLs that lack it, the docs give 307 as the status code, and Google's docs treat 307 as a temporary redirect, not a canonical signal. The fix is to generate _redirects at build time with one 301 per page: kagentx did this on 2026-11-09, and on 2026-11-10 we tested that kagentx.com/guides and /pricing both return 301.

Cloudflare static assets redirect trailing slashes with a 307: how does Google see it?

Google treats a 307 as a temporary redirect: Redirects and Google Search (checked 2026-11-10; the page carries no date) says 302, 303 and 307 are temporary, that Googlebot follows them but does not take them as a signal that the target should be the canonical URL, so the source URL may stay in results. Only 301 and 308 are permanent.

Cloudflare's Workers Static Assets: HTML handling (the page says updated 2026-04-23) states that the default mode auto-trailing-slash redirects the non-canonical form to the canonical one, and the status code in the page's tables is 307. The result: a URL missing one slash, like /guides, returns a temporary redirect by default on Cloudflare static assets.

For most sites this is a small matter, because the slash version is what you write in the sitemap and canonical. But if many external links, old links and social shares use the slash-less form, a temporary redirect is a weaker signal.

How did kagentx fix it?

On 2026-11-09 the marketing pages of kagentx.com were changed to generate a _redirects file at build time, with one slash-less to slash 301 for each page directory. Cloudflare's docs say a _redirects line can carry 301 and that the default is 302 when none is given; our approach is to write 301 explicitly. The generating script is web/scripts/build-cf.sh:

# web/dist/_redirects (generated at build time, one line per marketing page directory)
/guides /guides/ 301
/pricing /pricing/ 301
/zh/guides /zh/guides/ 301
/zh-hant/pricing /zh-hant/pricing/ 301
  1. 1. The rules run before the automatic slash handling

    When a page is requested without the slash, the 301 in _redirects matches first, instead of the static assets' default 307. The test in the next section shows the result.

  2. 2. Paths the Worker handles first are left out

    Paths the Worker takes first, such as /radar/, /agents/ and /p/, are left to the Worker to redirect and are not put in the file.

  3. 3. Exceeding the limit fails the build

    Cloudflare's docs say _redirects allows at most 2000 static rules; the script fails the build when that is exceeded, instead of silently dropping rules.

What does each of our four sites return today?

On 2026-11-10 we tested with curl, once each for the slash-less, slash and doubled-slash forms (paths are real pages on each site; gammaslide.com answers HEAD with 405, so its status codes were taken with GET):

Site (host)Without slashWith slashDoubled slash
kagentx.com(Cloudflare)/guides → 301 /guides/;/pricing → 301 /pricing/;/zh/guides → 301 /zh/guides/;/zh-hant/pricing → 301 /zh-hant/pricing//guides/ → 200/guides// → 307 /guides/
pagent.kagentx.com(Fly,经 Cloudflare 代理)/signals → 301 /signals//signals/ → 200//signals/ → 200
mochistamp.com(Fly)/en → 301 /en//en/ → 200//en/ → 404
gammaslide.com(Fly)/ja → 301 /ja/;/pricing → 200/ja/ → 200;/pricing/ → 301 /pricing//ja/ → 404

How to read it:

  1. 1. kagentx.com's slash-less URLs are already 301

    The fix works; the doubled slash such as /guides// still returns a 307, which we infer is the static assets' own slash handling still at work, since _redirects holds only the pages we wrote.

  2. 2. The four sites follow different conventions

    On gammaslide.com, /pricing is the canonical form and /pricing/ is what gets a 301; for other pages the slash form is canonical. What matters is that each page has exactly one canonical form, every other form 301s to it, and canonical, sitemap and internal links all use that one.

  3. 3. Doubled slashes do not necessarily need handling

    The three sites treat addresses starting with // differently (200, 404, 307); this is a rare form and outside the scope of this fix.

What is the difference between 301, 302, 307 and 308?

Status codeMeaningWhat Google's docs sayWhen to use it
301Moved permanentlyPermanent; a signal that the target should be canonicalThe address changed for good, or unifying the slash form
308Moved permanently; the client must resend with the same methodListed as permanent together with 301Permanent move where you do not want a POST turned into a GET
302Moved temporarilyTemporary; followed but not treated as a canonical signalA temporary jump, for example during a campaign
307Moved temporarily; the client must resend with the same methodListed as temporary together with 302 and 303A temporary jump that keeps the request method; Cloudflare static assets use it for automatic slashes

The “resend with the same method” column comes from the HTTP specification (RFC 9110), which we did not reopen today to check. Google's docs add two more points: an instant (0-second) meta refresh is treated as a permanent redirect and a delayed one as temporary; a JavaScript redirect should be used only when server-side and meta refresh redirects are not possible, and if rendering fails Google may never see it.

For how status codes affect AI crawlers see How do HTTP status codes affect AI crawlers? 404, 410, 301, 429, 5xx; for how to set canonical URLs see Canonical tags and duplicate content: how to set them up on a multilingual site so pages are not treated as duplicates.

How do the main hosts handle trailing slashes by default?

Only what we verified from official documents on 2026-11-10; what we could not read is marked unverified:

HostDefault behaviorHow to fixSource
Cloudflare Workers static assetsDefault auto-trailing-slash: adds the slash automatically, and the docs give 307 as the status codeOptions force-trailing-slash, drop-trailing-slash, none; for a 301 use _redirects as kagentx doesWorkers Static Assets: HTML handling
Cloudflare PagesUnverified: the docs page does not explain the default for slash-less URLs_redirects supports 301, 302, 303, 307 and 308, and defaults to 302 when no status is written; 2000 static and 100 dynamic rulesPages: Redirects
VerceltrailingSlash is unset by default: no redirectWith trailingSlash set to true or false it uses 308; with true, paths that have a file extension do not redirectvercel.json docs (the page says updated 2026-08-14)
NetlifyUnverified: the page we opened does not cover trailing slashes_redirects and netlify.toml default to 301 when no status is writtenRedirects overview
GitHub PagesUnverified: the page we opened does not cover itNot verifiedCreating a GitHub Pages site

How do I check my own site's trailing-slash redirects?

  1. 1. Get the status code for both forms

    The three commands below look at the slash-less form, the slash form and the whole redirect chain:

    # Status code and Location of the version without the trailing slash
    curl -sI https://example.com/guides | grep -iE "^HTTP|^location"
    # Same for the version with it (should be 200, no Location)
    curl -sI https://example.com/guides/ | grep -iE "^HTTP|^location"
    # Follow the whole chain and count hops
    curl -sIL -o /dev/null -w "%{http_code} hops=%{num_redirects} final=%{url_effective}\n" https://example.com/guides
  2. 2. Make sure there is only one canonical form

    A slash-less URL should do one 301 to the canonical form, and the canonical form itself should be 200 with no Location. If the chain is longer than one hop, merge it.

  3. 3. Make canonical, sitemap and internal links all use the canonical form

    Otherwise the signals Google sees contradict each other.

  4. 4. See whether crawlers hit the 307 in your logs

    If your host returns 307 by default and you cannot change it, add 301 rules as kagentx did.

FAQ

Does a trailing-slash 307 stop Google indexing my page?

Not by itself. Google's documentation says a 307 is a temporary redirect that Google follows but does not take as a signal that the target should be canonical, so the slash-less URL may stay in results. To make the slash version the only canonical URL, use 301 or 308, and match it in canonical and the sitemap.

Is there a difference between 301 and 308 for Google?

Google's documentation lists both as permanent redirects with the same wording. The difference is at the HTTP level: 308 requires the client to resend with the same method, while 301 has historically allowed turning a POST into a GET. That comes from the HTTP specification, which we did not reopen today.

Can Cloudflare static assets change the 307 to a 301?

In our case it could not be changed: html_handling only lets you choose automatic slash, force slash, drop slash or off, and the docs give 307 for its redirects. kagentx's workaround is to generate _redirects at build time with one 301 per page, which runs before the automatic slash handling.

Is there a limit on _redirects?

Cloudflare's docs say at most 2000 static rules and 100 dynamic rules, and recommend Bulk Redirects beyond that. kagentx's build script fails when it would exceed 2000.

What do Netlify and GitHub Pages return for a slash-less URL?

We have not verified this: neither official page we opened today covers it. Running the curl commands in this guide against your own site is the most reliable check.

Sources

kagentx

Do AI answers
mention you?

The evaluation checks whether crawlers can get in and whether the text is served directly, then asks ChatGPT, Perplexity and Claude (with web search on) your buyers' questions and sees whether you are mentioned. The Basic plan is $1, and results usually take 2–3 minutes.