How to do client-side rewrites on statically exported Next.js site?
I have a statically exported Next.js site, meaning a single-page app built with
next export
and uploaded to CF pages.
I've added a _redirects file with
/:org/service_/* /:splat 200
to mimic Next.js rewrites (e.g. user goes to /123/service_/contact-us
and lands on the /contact-us
page.
The rewriting is successfully happening. I get to the right page and see the right URL in the address bar. BUT all navigation causes a full re-render of the page, common elements included. Is there a way to do Next.js-style rewrites without causing full-page re-renders on every route change?0 Replies