Nextjs Redirect screenshot

Nextjs Redirect

Author Avatar Theme by Pablopunk
Updated: 27 Apr 2024
147 Stars

HOC to redirect to any URL in NextJS both in client and server

Categories

Overview:

Nextjs-redirect is a package designed to handle redirects in Next.js applications. It provides a convenient way to redirect users to specific URLs within your application. With features like customizable status codes, client-side dynamic routes, compatibility with static exports, and the ability to create custom UI components for redirects, nextjs-redirect offers a versatile solution for managing redirections in Next.js projects.

Features:

  • Customizable Status Codes: Ability to set different status codes for redirects.
  • Client-side Dynamic Routes: Smooth transition between dynamic pages without page refresh.
  • Static Export Compatibility: Compatible with Next.js static export feature.
  • Custom UI Component (HOC): Option to use custom components/styles for the UI during client-side navigation.
  • Redirect to URL from Parameters: Easily redirect users based on URL parameters.
  • Native Redirects: Provides a user-friendly way to handle redirects, including dynamic redirects based on requests.

Installation:

To install nextjs-redirect, you can use npm or yarn. Here’s how you can install the package:

npm install nextjs-redirect

or

yarn add nextjs-redirect

Summary:

Nextjs-redirect is a valuable package for managing redirects in Next.js applications. With its customizable features like status codes, dynamic routes, compatibility with static exports, and native redirect handling, it offers a comprehensive solution for developers. Whether you need to redirect users to external URLs or within your application, nextjs-redirect provides a flexible and user-friendly way to handle redirections efficiently.