Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
How Can I do the dynamic redirects in nextjs

I currently have a Next.js application which have dynamic routing. I have URLs of this form /o/:organizationIdentifier*/p/:projectIdentifier*/e/:environmentIdentifier*/settings/notification/categories

I want to create a documentation which won't need to specify the organizationIdentifier, projectIdentifier or environmentIdentifier. A user will just click on a link like, /settings/notification/categories and it will redirect them to the /o/:organizationIdentifier*/p/:projectIdentifier*/e/:environmentIdentifier*/settings/notification/categories and these variables will be pulled from a redux store. However, I tried something like:

const rewrites = [
  {
    source: "/settings/notification/categories",
    destination: "/o/:organizationIdentifier*/p/:projectIdentifier*/e/:environmentIdentifier*/settings/notification/categories",
    "permanent":true,
    "locale":false
  }
]

but I keep getting errors:

destination has segments not in source or has (organizationIdentifier, projectIdentifier, environmentIdentifier) for route {"source":"/settings/notification/categories","destination":"/o/:organizationIdentifier*/p/:projectIdentifier*/e/:environmentIdentifier*/settings/notification/categories","permanent":true,"locale":false}`

and

Error: Invalid redirects found

Any help on how I can achieve this functionality?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda