This is a pretty insane feature considering what it's called, what it's actually capable of, and how it's implemented...
Notice: It's confusing and important to understand if the "redirect rule" in question is a true 3xx style redirect or a more fancy rewrite.
The main features to implement:
Netlify will return status code 301 for what it calls basic redirects.
Netlify will perform a rewrite if a status code is set and not equal to 301, 302, 303.
By default Netlify will serve a 404.html file if it's provided and no redirect rules or static files match the path.
I'm not even gonna bother with this yet...
Basically param swapping between from and to - should be easy enough to implement with express and a url pattern library.
from = "/:partA/:partB"
to = "/:partB/:partA"
# "/foo/bar" β "/bar/foo"
Splats π€¦ββοΈ
Similar to placeholders except the * and :splat param are bound.
More or less states that query params can be used as placeholders, the syntax is weird but toml is luckily more readable that Netlify's _redirect file formatting.
These feature are getting way beyond my personal use cases - plus I don't see them being entirely useful for local development, it'd be great to support them but I'm not holding my breath.
This is a pretty insane feature considering what it's called, what it's actually capable of, and how it's implemented...
Notice: It's confusing and important to understand if the "redirect rule" in question is a true
3xxstyle redirect or a more fancy rewrite.The main features to implement:
build.publish)Redirect Features
Basic Redirects / Rewrites, Http Status Codes
Netlify will return status code
301for what it calls basic redirects.Netlify will perform a rewrite if a status code is set and not equal to
301,302,303.Custom 404
By default Netlify will serve a
404.htmlfile if it's provided and no redirect rules or static files match the path.404.htmlTrailing Slashes
I'm not even gonna bother with this yet...
Placeholders
Basically param swapping between
fromandto- should be easy enough to implement with express and a url pattern library.Splats π€¦ββοΈ
Similar to placeholders except the
*and:splatparam are bound.Query Params
More or less states that query params can be used as placeholders, the syntax is weird but
tomlis luckily more readable that Netlify's_redirectfile formatting.Hostnames & Protocols, GeoIP & Language
These feature are getting way beyond my personal use cases - plus I don't see them being entirely useful for local development, it'd be great to support them but I'm not holding my breath.