Reference for Netlify deployment — netlify.toml structure, redirect rules, static site config, functions
For static HTML sites with no build step:
[build]
publish = "."
. (root)# Rules are processed top-to-bottom, first match wins
# Passthrough rules first (public pages)
[[redirects]]
from = "/public-page.html"
to = "/public-page.html"
status = 200
# Role-gated rules (conditions)
[[redirects]]
from = "/*"
to = "/protected.html"
status = 200
force = true
conditions = {Role = ["rolename"]}
# Fallback redirects last
[[redirects]]
from = "/*"
to = "/login.html"
status = 302
force = true
Key rules:
force = true overrides even when a physical file exists at the pathforce, redirects only apply when no file existsstatus = 200 serves the target (rewrite), status = 302 redirects the browserconditions = {Role = ["viewer"]} checks JWT rolesnetlify/functions/ directory/.netlify/functions/<filename>identity-signup, identity-validate, identity-loginAlways verify which branch Netlify is deploying from before pushing. If production branch is set to a feature branch, pushing to main won't trigger a deploy.