Redirect all requests, except two slugs

Hallo,

is it possible to redirect all request, except two specific slugs?

Redirect all, e.g something like this works like a charm:

/* https://example.com/:splat

But i need something like this (The exclamation mark indicates the pages I don’t want to be redirected):

/* https://example.com/:splat
!/coming-soon
!/sign-up

Thanks for your help in advance!
All the best, Marvin

It is not possible to do in the way you describe.

I’d suggest that you should instead deploy only the files you want served, and then use the wildcard redirect to redirect everything else. This is the usual pattern that folks who ask for what you are asking for end up with.

This section of our redirects documentation will be useful in understanding why I recommend this: https://www.netlify.com/docs/redirects/#note-on-shadowing

There is an open feature request to allow negative pattern matching in redirects and I’ll add your voice to it, but I don’t expect the feature to arrive soon.