The Blog

Redirects that editors own

Headless CMSTechnical SEO

URL changes are inevitable, migrations, renames, restructures. The question is whether redirects live in a config file only developers can touch, or in the CMS where editors can manage them. We store ours in Payload and resolve them server-side in the App Router.

The problem

Every URL change is a potential 404

Every website accumulates URL debt. Services get renamed. Blog posts get recategorised. An entire site gets rebuilt on a new platform with a different information architecture. Without redirects, every old URL becomes a dead end, for visitors and for the search equity those pages earned over months or years.

Most teams handle this one of two ways. Developers add redirects to a config file that deploys with the codebase. Or someone maintains a spreadsheet that gets translated into server rules every few weeks. Both work until they don't, the config file becomes a bottleneck, and the spreadsheet drifts out of sync.

The underlying issue is ownership. Redirects are a content concern dressed up as a technical one. The people who know which URLs changed are editors and project managers. The people who can implement redirects are usually developers. That gap creates delays, missed redirects, and 404s that persist longer than they should.

The approach

Redirects as CMS content, resolved server-side

We treat redirects as first-class content in Payload CMS. Editors create redirect entries with a source path and a destination — either a hardcoded URL or a reference to a CMS document. The redirect collection lives alongside pages, posts, and other content types.

On the Next.js side, a utility fetches all active redirects and caches them using unstable_cache with a dedicated cache tag. When a visitor hits a URL that doesn't match any page, the catch-all route checks for a matching redirect before returning a 404. If it finds one, it issues a proper 301 redirect to the destination.

The cache tag is the key piece. Without it, every page request would query the redirect collection, unnecessary load for something that changes infrequently. With it, redirects are fetched once and served from cache until an editor creates, updates, or deletes a redirect entry. At that point, a collection hook revalidates the tag, and the next request picks up the fresh set.

What this enables

Four things editors can do without a developer ticket

Once redirects live in the CMS, common URL management tasks move from the deployment queue to the editorial workflow.

01Handle URL renames immediately

An editor renames a service page from `/services/web-design` to `/services/design-ux`. They create a redirect in the same session. No waiting for a deploy.

02Manage migration cleanup

After a platform rebuild, the team imports legacy URLs as redirects in bulk. Each one maps an old path to the new equivalent, or to a relevant alternative if the old page was retired.

03Redirect to CMS documents, not just URLs

Destinations can reference a Payload document rather than a hardcoded path. If the destination page's slug changes later, the redirect still resolves correctly because it follows the document reference.

04Audit active redirects in one place

The redirect collection is searchable and filterable. The team can see every active redirect, spot chains or conflicts, and clean up entries that are no longer needed.

Caching

Fast lookups without constant database queries

Redirects are a read-heavy, write-rare pattern. Most requests don't match a redirect at all — they resolve to a valid page. But every request needs to check, which means the lookup has to be fast.

We cache the full redirect set using the same tag-based pattern we use for sitemaps and content listings. The redirects utility wraps a Payload query in `unstable_cache` with a `'redirects'` tag. Collection hooks on the redirect model call `revalidateTag('redirects')` whenever an entry changes.

This means the redirect lookup on every page request is reading from cache, not querying the database. When an editor adds or changes a redirect, the cache busts, the next request fetches fresh, and everything after that reads from cache again.

It's the same principle as the rest of our caching architecture: aggressive caching for performance, instant updates when content changes.

The balance

Not every redirect belongs in the CMS

CMS-managed redirects handle the editorial use case well, page renames, migrations, restructures. But some redirects are infrastructure concerns.

Domain-level redirects (www to non-www, HTTP to HTTPS) belong in hosting or CDN configuration. Trailing-slash normalisation belongs in the framework config. Redirects that need to fire before the application boots, like legacy domain migrations, belong at the edge or in DNS.

We use Next.js config-level redirects for these structural patterns. They deploy with the codebase because they're not content decisions, they're infrastructure decisions that shouldn't change without a code review.

The split is straightforward: if an editor would reasonably need to create or change it, it goes in the CMS. If it's a platform-level rule that applies to every request regardless of content, it stays in config.

SEO impact

Speed, accuracy, and preserving link equity

Search engines follow redirects. A properly implemented 301 tells Google the old URL has permanently moved, and the ranking signals, backlinks, page authority, crawl history, should transfer to the new destination. A missing redirect means those signals are lost to a 404.

The speed of implementation matters too. The longer a 404 persists, the more likely Google is to drop the page from the index. If an editor renames a URL on Monday and the redirect doesn't go live until Thursday's deployment, that's three days of lost traffic and confused crawlers.

CMS-managed redirects close that gap. The redirect is created in the same session as the URL change. It's live within seconds, cached for performance, and visible to the whole team.

The best redirect is the one that's live before the old URL returns its first 404.

FAQs

Common questions about CMS-managed redirects

Yes. A chain, where URL A redirects to URL B, which redirects to URL C, adds latency for visitors and can cause search engines to stop following after a few hops. The redirect collection makes chains easy to spot and fix: search for any destination that's also a source.

The page takes priority. The catch-all route only checks redirects for URLs that don't match an existing page. This prevents accidental hijacking of live content.

Usually, yes. If /blog/category/design had indexed pages linking to it, redirect it to the new equivalent. If the old category had no traffic or links, a clean 404 with a good site search is sometimes better than a misleading redirect.

There's no hard limit, but thousands of redirects can slow lookup if they're not cached. Our caching approach means the count doesn't affect per-request performance, the full set is cached regardless of size.

Google has confirmed that 301 redirects pass ranking signals. The transfer isn't always 100% immediate, but it's the correct signal for permanent URL changes. 302s (temporary) are appropriate only when the old URL will come back.

Little Dash

Migrating platforms or restructuring your site?

We build redirect strategies into every migration so link equity transfers cleanly and editors can manage URL changes without developer tickets.