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.
When deploying on Netlify I get the expected results, hooray! However, Netlify Dev doesn’t correctly register the redirects, which makes it very painful to test. Any ideas what might be causing this? I’ll create an issue in the Github repo.
It works correctly in Netlify itself but indeed it hasn’t been fixed in Netlify Dev. I left a comment at that PR I linked to, but I haven’t had time to file a bug report. I’ve downgraded to 2.38.0 and am not using redirects in development for this reason. Might be worth opening an issue on the github repo.
Thanks @sanderfish and @perry
I wasn’t clear about the state of the original problem.
I will troubleshoot to find some simple cases and file a bug report.
We are planning on using Next.js with SSG export for level 1 delivery backed up by serverless for level 2. I suspect it would work on Netlify itself, but I wanted to make sure netlify dev worked too.