Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

155
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda