I’m trying to see if it’s possible to have a site with a few paths served by Netlify (with Gatsby) and the rest in an existing WordPress site as we slowly migrate more paths over to the Gatsby site.
I found a question on StackOverflow answered by @fool. I’m attempting that answer in my app but can’t get it working correctly. I’m aware that some changes to Redirects and specifically to shadowing, which I’m attempting to use here, are going in effect tomorrow. I’m not sure what the current state of these changes is and if newly setup redirects are already impacted by those changes. I have tried to run my setup on Netlify Dev (v2.40) and am currently deploying on Netlify to see what happens there.
The Gatsby site builds pages for two paths: /shop/:slug and /product/:slug. Any other route should be proxied to a different site. According to the documentation on Shadowing, adding a global redirect should go in effect for any route that doesn’t exist on the filesystem.
/* https://wpsite.com/:splat 200
The site’s file system looks like this:
/shop /category-2 index.html /category-2 index.html /product /product-1 index.html /product-2 index.html
With the above configuration I would expect the following
https://netlifysite.com/ > https://wpsite.com
https://netlifysite.com/somepage > https://wpsite.com/somepage
https://netlifysite.com/shop/category-2 > serve from filesystem
https://netlifysite.com/product/product-1 > serve from filesystem
Currently the redirect rule proxies all traffic to https://wpsite.com/:splat.
Curious if anyone has any idea what might be wrong here