Configure simple Redirects within your Nuxt application ➡️
yarn add nuxt-easy-redirect # yarn
npm i nuxt-easy-redirect # npm
pnpm add nuxt-easy-redirect # pnpm
Add nuxt-easy-redirect
to your Nuxt config:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-easy-redirect"],
});
You can configure nuxt-easy-redirect
in your nuxt.config.ts
file:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-easy-redirect"],
redirects: {
verbose: true,
rules: [
{
origin: "/about",
destination: "/about-us",
statusCode: 302,
},
{
origin: "/about1",
destination: "/about-us2",
statusCode: 301,
},
],
},
devtools: { enabled: true },
});
- Clone this repository
- Install dependencies using
pnpm install
ornpm install
- Run
pnpm dev:prepare
ornpm run dev:prepare
- Start development server using
pnpm dev
ornpm run dev
Copyright (c) 2023 casualmatt Apache License 2.0