'How to exclude the images directory in a redirect source in NextJS
I followed this tutorial which is perfect for my NextJS website.
The problem is my unsupported.html file has images in it. The images 404 because according to the redirects everything except unsupported.html will redirect (including the images).
So here is Chrome vs IE. So Chrome works because I manually went there and it won't redirect anything because it's not IE.
How can I add to this part source: '/:path((?!unsupported.html$).*)', to say don't redirect unsupported.html AND anything in the /public/images/ folder?
Thanks This feels close
source: '/:path((?!unsupported.html|.*images*$).*)',
Solution 1:[1]
Does this work for your site?
source: '/:path((?!unsupported\.html$|images/).*)',
The key bit is dropping the $ anchor from after images, so it doesn't have to (not) match the actual image name
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


