⚠️
The vite-plugin-ssr project has been renamed Vike.
  • If you are already using vite-plugin-ssr then migrate to Vike.
  • For new projects, don't use vite-plugin-ssr but use Vike instead.

config.redirects

See also:

// vite.config.js

import { ssr } from 'vite-plugin-ssr/plugin'

export default {
  plugins: [
    ssr({
      // Permanent redirections (HTTP status code 301)
      redirects: {
        '/about-us': '/about',
        // Parameterized redirections
        '/product/@id': '/buy/@id',
        // Glob redirections
        '/admin/*': '/private/*',
        // External redirections
        '/admin/*': 'https://admin.example.org/*'
      }
    })
  ]
}