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?