How to properly handle URL slug changes in Next.js
summary
Claims a concrete recipe: track slug history in Kontent items, enumerate all historic and current slugs, serialize that list to a cached file, and feed it into Next.js so getStaticPaths includes historic routes while getStaticProps issues a permanent redirect to the current path. Implementation uses TypeScript and a kontent-boilerplate example, writes path objects with {path, redirectTo}, and works around Next.js limitations by reading the serialized paths at build time so historic URLs 301/308 to the live page.
AI-written summary · about
related talks
31mType Safe URL State Management in React with nuqs
10mGradual Migration Strategies for Next.js
05mIncrementally Adopting Next.js
25mType-safe URL state in with nuqs
10mTaking the Next step
29mHandle routes data using stateless protocol (using React Router)
37mHands On: How To Migrate To 16 and "Use Cache"
43mRoute Recalculating
