@rspress/plugin-client-redirects
Used for client redirects.
Before using this plugin, make sure your deployment environment has the fallback page correctly configured. See the SSG refresh-404 guide for details.
Note: Client-side redirects differ from server-side redirects — the page will load first and then redirect (causing a brief flash), and SSR is not supported. If your deployment platform supports server-side redirects (301/302), prefer using that approach for better SEO and user experience.
Installation
Usage
Write the following configuration in the configuration file:
Configuration
This plugin supports passing in an object configuration. The properties of this object configuration are as follows:
from represents the matching path, to represents the path to be redirected, and using regular expression strings is supported.
One to supports matching multiple from: they will redirect to a single path.
One from cannot correspond to multiple to: there needs to be a unique and clear redirection path.