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: Redirects and rewrites | Netlify Docs

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.

I am seeing a file not found after deploy don’t know how to fix it

Hi there,

Did you see this guide yet? This is the best place to start for “Page Not Found” issues.

If you are still seeing issues after following the troubleshooting steps in this guide, please let us know in a separate post please.