I have a blog made with Next.js and data is coming from CMS (Headless WordPress).
Assume every post has a title and an id. I want to create short links for my blog, so every site.com/blog/[id] (or site.com/blog/?id=[id]) automatically redirects to site.com/blog/[title].
Also, it should be dynamic; so every time a new post is created, the short link should be generated too.
I'm a little bit confused about how to do this. Should I do it per post? Should I define redirect/rewrites in Next.js config? Should I do it server-side, like with .htaccess? Should it be redirect or rewrite?
Also in GitHub Discussions: https://github.com/vercel/next.js/discussions/39897