diff --git a/src/node/plugins/rewritesPlugin.ts b/src/node/plugins/rewritesPlugin.ts index 868f7967..ebda4d4f 100644 --- a/src/node/plugins/rewritesPlugin.ts +++ b/src/node/plugins/rewritesPlugin.ts @@ -8,7 +8,7 @@ export function resolveRewrites( ) { const rewriteRules = Object.entries(userRewrites || {}).map(([from, to]) => ({ toPath: compile(to), - matchUrl: match(from) + matchUrl: match(from.startsWith('^') ? new RegExp(from) : from) })) const pageToRewrite: Record = {}