diff --git a/.changeset/cuddly-walls-remember.md b/.changeset/cuddly-walls-remember.md new file mode 100644 index 0000000000..9057e1ac09 --- /dev/null +++ b/.changeset/cuddly-walls-remember.md @@ -0,0 +1,5 @@ +--- +'@astrojs/underscore-redirects': patch +--- + +Fixes a regression which used the wrong pattern for dynamic pages diff --git a/packages/underscore-redirects/src/astro.ts b/packages/underscore-redirects/src/astro.ts index 8d91847e0d..c8ff5208a5 100644 --- a/packages/underscore-redirects/src/astro.ts +++ b/packages/underscore-redirects/src/astro.ts @@ -100,7 +100,7 @@ export function createRedirectsFromAstroRoutes({ } _redirects.add({ dynamic: true, - input: `${base}${route.pattern}`, + input: `${base}${pattern}`, target, status: route.type === 'redirect' ? 301 : 200, weight: 1, @@ -108,7 +108,7 @@ export function createRedirectsFromAstroRoutes({ } else { _redirects.add({ dynamic: true, - input: `${base}${route.pattern}`, + input: `${base}${pattern}`, target: dynamicTarget, status: 200, weight: 1,