Skip to content
Latchkey

Netlify Redirects Not Applied - Fix netlify.toml / _redirects

Netlify deployed your site but the redirects/rewrites are ignored - the _redirects file is not in the publish directory, the netlify.toml rules are ordered wrong, or the SPA fallback is missing, so deep links 404.

What this error means

A deployed route returns 404 or skips an expected rewrite even though a rule exists. It is deterministic: the rule is either not shipped to the right place or shadowed by an earlier rule, so it never matches.

Netlify behavior
# Visiting /app/dashboard on a deployed SPA:
Page not found  (404)
# _redirects ended up outside the publish dir, so the SPA fallback never shipped

Common causes

Rules not in the publish directory / wrong source

A _redirects file must live in the publish directory at deploy time. If it is in the repo root but the publish dir is dist, it is not shipped, so no rules apply.

Ordering or missing SPA fallback

Netlify applies the first matching rule, so a broad rule placed before a specific one shadows it. A missing /* → /index.html 200 fallback makes client-routed deep links 404.

How to fix it

Define redirects in netlify.toml with the SPA fallback last

Keep rules in netlify.toml (versioned, no path issues) and put the catch-all fallback last so specific rules win.

netlify.toml
# netlify.toml
[[redirects]]
  from = "/api/*"
  to = "/.netlify/functions/api/:splat"
  status = 200

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Or ship _redirects into the publish dir

  1. Place _redirects so the build copies it into the publish directory (e.g. public/_redirects for Vite).
  2. Order rules specific-first, catch-all last - the first match wins.
  3. Verify on the deployed URL (and the deploy log’s "X redirect rules processed").

How to prevent it

  • Prefer netlify.toml redirects so rules are versioned and path-independent.
  • Always order specific rules before the SPA catch-all.
  • Confirm the deploy log reports the expected number of redirect rules.

Frequently asked questions

What causes "redirects not applied"?
A _redirects file must live in the publish directory at deploy time. If it is in the repo root but the publish dir is dist, it is not shipped, so no rules apply.
How do I fix redirects not applied?
Keep rules in netlify.toml (versioned, no path issues) and put the catch-all fallback last so specific rules win.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card