⚠️
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.

URL Normalization

By default, URLs are normalized:

[vite-plugin-ssr] HTTP request: /some//path/
[vite-plugin-ssr] URL normalized from /some//path/ to /some-path
[vite-plugin-ssr] HTTP redirect /some/path 301

You can configure whether URLs are normalized and whether URLs should end with a trailing slash:

// vite.config.js

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

export default {
  plugins: [
    ssr({
      // Make URLs end with a trailing slash.
      // For example: /some//path -> /some/path/
      trailingSlash: true,

      // Or completely disable automatic URL normalization.
      // For example keep URL /some//path/
      disableUrlNormalization: true
    })
  ]
}