_redirects file lists rules that redirect, rewrite or proxy matching URLs on a static site, or answer them with a custom 404 page. Sevalla reads the file at every deployment and applies its rules at the edge. It uses Netlify’s _redirects format, without the parts listed in Unsupported features. For trailing slashes and extension-less URLs, turn on pretty URLs instead of writing rules.
Add a redirects file
1
Create the file
Create a file named
_redirects, with no extension, so that it ends up in the publish directory. Many generators copy the files of a public folder into their output. Sevalla also finds the file in the build’s root directory, but looks in the publish directory first.2
Add the rules
Write one rule per line. See Rule syntax.
3
Deploy
Commit and push the file, then deploy the site if the push doesn’t.
_redirects file, then Redirects processed successfully!. Sevalla doesn’t publish the file itself: /_redirects returns 404. Changes to the file apply from the next deployment.
Rule syntax
_redirects
Blank lines are ignored, and
# starts a comment, at the start of a line or after a rule. A line Sevalla can’t read fails with Missing destination path/URL, The destination path/URL must start with "/", "http:" or "https:", or Invalid status code (for example, conditions without a status code).
How from paths match:
- Case doesn’t matter, and a trailing slash is optional:
/old-pagematches/old-page,/old-page/and/Old-Page. - The whole path must match.
/docsdoesn’t match/docs/guide; use a splat for that. - Write spaces and non-ASCII characters percent-encoded, as browsers send them:
/caf%C3%A9, not/café. - Paths with
(,),{,},?or+can’t be matched.
Status codes
Use only these codes. Sevalla skips a rule with any other status code, such as
410.
For redirects (301 to 308), a to path stays on the domain that was requested. When the rule has no query parameters and to has no ?, Sevalla adds the request’s query string to the target: with the rule /shop /store, /shop?ref=mail redirects to /store?ref=mail.
_redirects
Rewrite a URL
A rule with status200 serves another file at the requested URL. The address in the browser doesn’t change.
_redirects
/pricing-2026.html or /blog/index.html. Folder URLs such as /blog/ and extension-less paths such as /about don’t resolve as rewrite targets.
Proxy another site
Whento is a full URL, a 200 rule fetches that URL and returns its response at your URL:
_redirects
GET and HEAD responses at the edge like the site’s own files (for 30 days, or until the next deployment) and removes their Set-Cookie headers. Proxy only public content that can be cached; call APIs from the browser instead.
Custom 404 pages
A404 rule serves a page of your own, with status 404, for URLs that have no file:
_redirects
200. Search engines then index missing URLs as real pages, so use a 404 rule for a 404 page. Without either, Sevalla serves its own 404 page with status 404.
Force a rule
By default, a rule doesn’t apply when the requested URL matches a file in the deployment, so a rule can’t hide a page that exists. Add! after the status code to apply the rule anyway:
_redirects
/docs/v1/ URL, even though the version 1 files are still in the deployment. A URL matches a file when the site would serve one for it: the file itself, the Index file of a folder, and, with pretty URLs on, about/index.html or about.html for /about/.
Splats
A* at the end of from, after a /, matches the rest of the path, slashes included. Use :splat in to to insert what it matched:
_redirects
/news/2026/launch redirects to /blog/2026/launch. The rule matches /news/ and everything below it, but not /news.
A splat works only at the end of the path. A * anywhere else, as in /docs/*.html, makes the rule invalid, and requests that reach it fail.
Placeholders
A:name segment in from matches one path segment, the text between two slashes. Use the same name in to:
_redirects
/store/audio/headphones redirects to /products/audio/headphones. Use each placeholder once in to.
Query parameters
List query parameters betweenfrom and to. key=:name captures the parameter’s value as a placeholder; key=value requires that exact value:
_redirects
- The request must have exactly the listed parameters, no more and no fewer, in any order.
/search?q=laptopsmatches the first rule;/search?q=laptops&sort=ascdoesn’t. - List combinations from the most parameters to the fewest, as for
/items, so the right rule matches first. - A rule with query parameters doesn’t pass the query string on. Use the captured values in
toinstead.
Header conditions
AHeader:Name=value condition after the status code applies the rule only to requests that carry that header with that value:
_redirects
- The header name isn’t case-sensitive. The value is, and it must equal the whole header value: a request with
Accept: text/markdown, text/htmldoesn’t matchtext/markdown. - Allow more than one value with commas and no spaces:
Header:X-Variant=b,cmatchesborc. - Leave the value empty to require only the header:
Header:X-Preview=matches any value. - Add more than one condition with spaces between them: all must match.
- A request without the header skips the rule.
302 or 307 rather than 301, because browsers remember 301 redirects without checking the header again. Sevalla caches responses by URL, so a header-conditioned rewrite (200) can return the rewritten file to requests without the header.
Redirect one domain to another
A full URL infrom matches only requests to that domain. To send every www request to the apex domain:
_redirects
! makes the rule apply to URLs that have a file too.
Rule order
Sevalla checks rules from the top of the file and applies the first one that matches. A rule whose query parameters or header conditions don’t match is skipped, and the next rule is checked. Put specific rules above general ones: a/* rule at the top catches everything below it.
Serve a single-page application
For a single-page application whose router handles paths in the browser, serveindex.html for every URL that has no file:
_redirects
Pretty URLs
Pretty URLs give every page URL a trailing slash: Sevalla redirects (301) /about and /about.html to /about/, and serves about/index.html or about.html there. Search engines see one URL per page. It’s off for new sites.
With pretty URLs off, folder URLs use the Index file build setting, and
/about doesn’t serve about.html. If your generator writes pages as about.html, turn pretty URLs on. The trailing-slash redirect keeps the query string. Your _redirects rules then run on the /about/ request, and rules written as /about or /about.html match it.
1
Open the pretty URLs setting
In the sidebar, click Static sites, then click the site. Click the Settings tab and, under Redirects, click Enable pretty URLs.
2
Confirm
In the dialog, click Enable pretty URLs.
3
Purge the cache
Click the Networking tab, then click Purge cache, so the edge stops serving responses it cached before the change.


Unsupported features
Sevalla reads Netlify’s line format, but not every Netlify feature:- Conditions other than
Header:, such asCountry=,Language=,Role=andCookie=, are ignored. A rule with only these conditions applies to every request. - Signed proxy rules (
Sign=) aren’t signed. - Status codes other than
200,301,302,303,307,308and404. - A
*anywhere but the end offrom. - Rules in
netlify.toml, and the custom headers they can set per rule. For headers, use a_headersfile.