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

158
Visualizações
next redirects/rewrite with static generation

Is there a way to use redirect or rewrite statically?

I have a blog (deployed on github pages), and I have already shared the link of posts on other places, the thing is, I want to change it from myblog.com/post/slug-here to myblog.com/a/:slug-here and that's gonna break the old links i've already shared

Using the redirects() on next.config.js would be perfect, but on the docs it says that only works on Node.js environments

I also tried the rewrites()

  async rewrites() {
    return {
      fallback: [
        {
          source: '/post/:slug',
          destination: '/a/:slug',
        },
      ],
    };

(because the docs doesn't say anything about only for Node.js environments) but without luck that also didn't worked. I think the only diference between them is that rewrites() "mask" the URL to make it appear that the URL haven't changed

just in case i'm missing something: it works on yarn dev but not in production.

how could I achieve that statically generating?

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