Next.js Discord

Discord Forum

Next x WordPress

Unanswered
West African Lion posted this in #help-forum
Open in Discord
Avatar
West African LionOP
Hey guys,

I've been using Next for a while and then took a break for a while because the new job I had was using Gatsby instead, however I'm in the final stages of migrating our main hub over to Next and I have run into a minor roadblock.

Our organisation makes a lot of use of redirects for various reasons, and when running the build command there's no issue with this, as I can set the redirects up in next.config.js and it works perfectly.

As a WordPress site, one of the main selling points of Next.JS is the incremental static regeneration and hooking into WordPress' save_post hook to trigger a webhook which will revalidate the URL that has been created or updated.

However, redirects are generated at build time, and I can't see a way that I can trigger redirects to 'revalidate' without rebuilding the entire site.

So my question is - has anyone else tried to work around this issue, and if so, what success did you have and how did you ultimately solve the 'problem' of handling redirects without having to rebuild the entire site?

Thanks!

0 Replies