Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!