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
fool
July 10, 2019, 2:01pm
2
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
perry
March 12, 2020, 8:18pm
5
Hi there,
Did you see this guide yet? This is the best place to start for “Page Not Found” issues.
Last reviewed by Netlify Support - August, 2023
Netlify attempts to lookup a file based on several xor filters, and when all of these fail, we end up serving a 404 page. For example, a request made to /example/ would check /example/index.html, /example.html, /example/home.html and several other combinations (not necessarily in the same order) before hitting the 404. However, in case you were not expecting a 404 at a particular URL, you might be interested in finding out the reason and potentia…
If you are still seeing issues after following the troubleshooting steps in this guide, please let us know in a separate post please.