--- import { getAllPosts } from "@/data/post"; import type { GetStaticPaths } from "astro"; // if you're using an adaptor in SSR mode, getStaticPaths wont work -> https://docs.astro.build/en/guides/routing/#modifying-the-slug-example-for-ssr export const getStaticPaths = (async () => { const blogEntries = await getAllPosts(); return blogEntries.map((post) => ({ params: { slug: post.id }, props: { post }, })); }) satisfies GetStaticPaths; const currentPath = Astro.url.pathname; const newPath = currentPath.replace("/blog/", "/posts/"); return Astro.redirect(newPath); ---