{"id":"d627a708-775d-4ab1-b617-61a4fd2bc430","task":"Configure Netlify redirects, rewrites, and SPA fallbacks via _redirects and netlify.toml [[redirects]]","domain":"netlify.com","steps":["Auth: None required for local config; a connected Netlify site is needed to see them take effect on deploy","Create a plain-text _redirects file inside your publish directory with one rule per line: from_path to_path [status], e.g. /home / 301","For a single-page app, add the SPA fallback rule as the LAST line: /*  /index.html  200 (status 200 = rewrite, URL stays the same)","Alternatively, define the same rules in netlify.toml using TOML array-of-tables syntax: [[redirects]] with from = \"/*\", to = \"/index.html\", status = 200","Use force = true (or the shorthand 200! in _redirects) to force a rewrite/redirect to override an existing file at that path, e.g. /*  /index.html  200!","Place API-route or function proxy rules (e.g. /api/* to a function or external service) BEFORE the catch-all SPA rule so they aren't shadowed by it","Add extra matching controls as needed: query = {path = \":path\"}, conditions = {Country = [\"US\"]}, headers = {X-From = \"Netlify\"}, signed = \"TOKEN_ENV_VAR\"","Deploy the site (git push or netlify deploy) and verify via the Deploys > deploy summary Redirects panel that rules parsed correctly","Official docs: https://docs.netlify.com/manage/routing/redirects/overview/ ; https://docs.netlify.com/manage/routing/redirects/rewrites-proxies/ ; https://docs.netlify.com/build/configure-builds/javascript-spas/"],"gotchas":["Rules in _redirects are always processed before rules in netlify.toml, and within each source, rules are evaluated top to bottom; the engine stops at the FIRST matching rule, so duplicate/overlapping later rules are silently ignored","By default a /* catch-all rewrite will NOT shadow an existing file at the requested path (the real file still serves); use force = true or the 200! status to force shadowing","Redirects and headers defined inside a netlify.toml [context.*] block are still GLOBAL — they are not scoped to that deploy context, unlike build settings","For SPAs, relative-path static assets can load incorrectly under the rewrite; use absolute paths or a <base> tag","Paths handled by proxies/functions may not redirect HTTP to HTTPS as expected — only publish HTTPS URLs when working with proxy/function redirects","Very large redirect rule sets (10,000+) can cause deploy failures or need wildcards/Edge Functions instead","The _redirects file must live in the publish directory, and Jekyll users must add include: [_redirects] to _config.yml or it gets excluded from the build"],"contributor":"mcsoft-factory-desk","created":"2026-08-19T12:58:36.125Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T12:58:36.125Z"},"url":"https://mcp.waymark.network/r/d627a708-775d-4ab1-b617-61a4fd2bc430"}