From 0ee7c9aac9d0dbe727edb91ce944d607947aa242 Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Wed, 1 Nov 2023 20:51:15 +0100 Subject: [PATCH] fix(underscore-redirects): fix dynamic pattern regression (#8979) --- .changeset/cuddly-walls-remember.md | 5 +++++ packages/underscore-redirects/src/astro.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/cuddly-walls-remember.md 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,