V2: need help with the json configuration for custom 404 and redirects

Thank you!
I am making progress with this, apparently this will work:

{
  "handle": [
    {
      "handler": "static_response",
      "headers": {
        "Location": ["/legal{http.request.uri}"]
      },
      "status_code": 301,
      "close": true
    }
  ],
  "match": [
    {
      "path_regexp": {"name": "legal", "pattern": "^(\/)(terms|(cookie|privacy)-policy)(\/)?"}
    }
  ]
},

And it will also carry the query string with it, so i guess this is the way to do this?

How about the custom 404 pages, shouldn’t that be pretty straight forward to accomplish?