diff --git a/integrations/redirect.ts b/integrations/redirect.ts index 700f2d03d4..2a1b25c027 100644 --- a/integrations/redirect.ts +++ b/integrations/redirect.ts @@ -30,10 +30,9 @@ export default function redirect(): AstroIntegration { const { redirect_to, redirect_from } = file.data; const here = "/" + - relative(pages, file.path).replace( - /(?:index)?\.(?:md|mdx|markdown|astro)$/, - "", - ); + relative(pages, file.path) + .replace(/\\/g, "/") + .replace(/(?:index)?\.(?:md|mdx|markdown|astro)$/, ""); if (typeof redirect_to === "string") { return { from: here, to: redirect_to }; }