← Back to store

How it works

This demo uses Vercel's bulk redirects feature to manage seasonal URLs without code changes.

The problem

E-commerce sites often need vanity URLs that stay consistent while the content behind them changes:

  • /catalog/fall should always show the current fall collection
  • /catalog/latest should point to the newest drop
  • Retired product SKUs should redirect to relevant collections

The solution

Vercel's bulk redirects let you manage thousands of redirects at the edge—no middleware, no server-side logic.

1. Define redirects in a JSON file

Or fetch them from a CMS like Contentful, Sanity, or any API

2. Use vercel.ts to generate at build time

The config file runs during build and outputs the redirect rules

3. Redirects execute at the edge

Fast, globally distributed, no app code involved

Example code

// vercel.ts
import type { VercelConfig } from '@vercel/config/v1'
import { writeFileSync } from 'fs'

const redirects = [
  {
    source: '/catalog/fall',
    destination: '/catalog/fall-2025',
    statusCode: 302
  },
  {
    source: '/catalog/latest',
    destination: '/catalog/spring-2026',
    permanent: true
  }
]

writeFileSync(
  'generated-redirects.json',
  JSON.stringify(redirects, null, 2)
)

export const config: VercelConfig = {
  bulkRedirectsPath: './generated-redirects.json',
}

Try it

Click these links to see the redirects in action:

Resources