A content URL migration affects bookmarks, search listings, internal links, and external references. Treat it as a mapping problem with a verified source and destination for every published article.
Inventory before changing routes
Export the current slugs and identify the canonical destination for each one. Include variants such as trailing slashes, old prefixes, and encoded characters. Preserve a direct mapping from old paths to new paths rather than building redirects from loose string rules that can catch unrelated routes.
Use a permanent redirect only when the destination is the same content or a clear replacement. Keep redirects one hop where possible; chains add latency and complicate future changes. If content has no replacement, return an intentional not-found or gone response instead of redirecting to the home page. Maintain the old-to-new map as source data so future editors can see existing aliases.
Verify the migration
Test each old URL, confirm the final status and location, and check that the destination returns the canonical link. Crawl internal links and the sitemap after deployment. Watch server logs for old paths that still receive traffic and update prominent internal references. Search tools may take time to reflect changes; a redirect is not a guarantee of immediate indexing.
Keep the migration reversible until route behavior is confirmed. A successful URL migration lets old links keep working while new pages use one clear canonical address.
Treat a redirect map as part of the content release
A durable migration starts with an old path, an article identity, and a verified target. List aliases that readers bookmarked, then check the response chain for each. A complete release also updates navigation links, canonicals, and the sitemap to the destination. Changing only the route leaves new links continuing to point into the old redirect path.
In the App Router, permanentRedirect normally responds with 308 and preserves the request method through the redirect. Streaming and Server Action contexts have their documented exceptions. Test a real HTTP request and a browser navigation separately when a path can take both forms. For articles that were unpublished or restricted, also verify a visitor cannot reach their content through an old alias. Next.js redirect API
Worked example
Keep explicit mappings instead of replacing URL prefixes blindly. Test the old path, canonical path, missing article, and a private article; redirects must not bypass access checks.
json{ "sourcePath": "/articles/legacy-id", "targetPath": "/blog/author/stable-slug", "articleId": "stable-id" }




Community
Discussion
Loading comments…