Redirect Manager
Manage and configure redirects directly from the Strapi admin panel.
Strapi Plugin: Redirect Manager
🔁 Centralized redirect management for Strapi v5 – create 301/302 redirects directly from the admin panel
✨ Features
- 🌐 URL Redirects: Easily manage 301, 302 (and more) HTTP redirects
- 🧠 Pattern Matching: Supports wildcards like
/blog/:slugand RegExp - 🎛️ Intuitive Admin UI: Seamlessly integrated into the admin panel
- 🔄 Auto Middleware: Handles redirects at runtime (optional)
- ✅ Draft & Publish: Preview redirect entries before going live
- 🧩 API Accessible: Easily fetch redirects for use in frontend frameworks
🎯 Compatibility
| Environment | Version | Status |
|---|---|---|
| Strapi | v5.0.0+ | ✅ Fully Supported |
| Node.js | 18.x, 20.x, 22.x | ✅ Tested |
| Database | PostgreSQL, MySQL, SQLite | ✅ Compatible |
| Frontends | Next.js, Nuxt, Remix, Astro | ✅ Compatible |
📦 Installation
npm install strapi-plugin-redirect-manager
# or
yarn add strapi-plugin-redirect-manager🛠️ Setup
- Add to plugins configuration (config/plugins.js):
module.exports = {
'redirect-manager': {
enabled: true,
},
};- Restart your Strapi application:
npm run developor
yarn develop📡 API Endpoints
The redirect-manager plugin exposes multiple APIs to manage redirects, settings, and content resolution.
All routes are prefixed with:
1/api/redirect-manager🔁 1. Get Single Redirect
Endpoint:
1GET /api/redirect-manager/redirectDescription: Fetch a single redirect by query parameters.
Query Params:
from – The source path (e.g. /old-blog)
📋 2. Get All Redirects
Endpoint:
1GET /api/redirect-manager/redirect/allDescription: Fetch all registered redirects.
⚡ Next.js Integration Example
You can integrate the Redirect Manager plugin with Next.js to automatically apply server-side redirects.
1. Create a Redirect Fetcher
Inside your Next.js project, add a helper to fetch redirects from Strapi:
1// lib/getRedirectHistory.ts
2export async function getRedirectHistory(contentType: string, slug: string) {
3 try {
4 const path = `redirect-manager/redirect`;
5 return fetchAPI(
6 path,
7 { oldSlug: slug, contentType },
8 { prefix: "" }
9 );
10 } catch (error) {
11 console.error("Failed to fetch redirect history:", error);
12 return { data: null };
13 }
14}2. Dynamic Redirect from Content
You can also fetch content-based redirects (from slugs) in getServerSideProps:
1// pages/[slug].tsx
2import { GetServerSideProps } from "next";
3
4export const getServerSideProps: GetServerSideProps = async ({ params }) => {
5 const slug = params?.slug as string;
6 const contentType = "api::article.article";
7
8 const redirect = await getRedirectHistory(contentType, slug);
9
10 if (redirect?.data) {
11 return {
12 redirect: {
13 destination: redirect.data.newSlug,
14 permanent: redirect.data.redirectType === "301",
15 },
16 };
17 }
18
19 // fallback: fetch content if no redirect
20 const res = await fetch(`${process.env.STRAPI_URL}/api/articles/${slug}`);
21 if (res.status === 404) {
22 return { notFound: true };
23 }
24 const data = await res.json();
25 return {
26 props: { article: data },
27 };
28};
29
30export default function ArticlePage({ article }: any) {
31 return <div>{article.title}</div>;
32}Install now
npm install strapi-plugin-redirect-manager
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.