By Alex Bennett
The v5 version of my redirects plugin
released August 20, 2025
npm install strapi-v5-redirectsThis plugin provides a simple way to manage URL redirects within Strapi (v5), allowing developers and content managers to create and handle redirects directly from the CMS. The plugin does not automatically handle redirects on the server side, but instead offers a structured API that your frontend application (like a Next.js site) can use to implement redirection logic.
Source), the destination URL (Destination), and whether the redirect is permanent (Permanent)./api/redirects, making it easy for frontend applications to fetch and implement redirects.npm install strapi-plugin-redirects or yarn add strapi-plugin-redirects
module.exports = ({ env }) => ({
// Other plugin configurations...
redirects: {
enabled: true,
},
});Redirects section within the plugins area.Add New Redirect and fill in the Source, Destination, and Permanent fields accordingly.api/redirects endpoint.api/redirects. The response will be a JSON object listing all configured redirects.If your project contains a large number of redirects (hundreds or thousands), you may need to adjust the default and maximum limits for the REST API responses in Strapi. This can be done by modifying the api.js or api.ts file in your Strapi configuration. You can set the defaultLimit and maxLimit for your API responses as shown below:
module.exports = ({ env }) => ({
rest: {
defaultLimit: 100, // Default number of items returned in a single response
maxLimit: 250, // Maximum number of items allowed in a single response
},
});You can import redirects in bulk by uploading a CSV file with source, destination, and permanent headers. Both relative and absolute paths are supported for maximum flexibility, and specifying permanent or temporary via a boolean field correctly maps to the respective redirect type.
This plugin is ideal for content editors or SEO specialists managing redirects in a headless CMS setup. Here's how you can integrate it with a Next.js project:
next.config.js.Example script for fetching redirects:
const redirects = () => {
return fetch('http://localhost:1337/api/redirects')
.then(res => res.json())
.then(response => {
// Use redirects however you need to
});
};
module.exports = redirects;Incorporate the fetched redirects into next.config.js:
const getRedirects = require('./redirects');
module.exports = {
// Other configurations...
redirects: () => getRedirects(),
};Contributions in the form of translations, feature enhancements, and bug fixes are highly encouraged and appreciated.
Feel free to reach out or submit pull requests on GitHub if you're interested in contributing to the development of this plugin.
This plugin is available under the MIT License. For more information, please refer to the LICENSE file in the repository.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
