diff --git a/.changeset/tall-penguins-bow.md b/.changeset/tall-penguins-bow.md new file mode 100644 index 000000000..0add719c4 --- /dev/null +++ b/.changeset/tall-penguins-bow.md @@ -0,0 +1,5 @@ +--- +"@headstartwp/next": patch +--- + +Fix redirect status code when set to permanent' diff --git a/packages/next/src/data/server/handleError.ts b/packages/next/src/data/server/handleError.ts index db2526225..b3394d441 100644 --- a/packages/next/src/data/server/handleError.ts +++ b/packages/next/src/data/server/handleError.ts @@ -93,7 +93,7 @@ export async function handleError( return { redirect: { destination: redirect.location, - permanent: false, + permanent: redirect.status === 301 || redirect.status === 308, }, }; }