Skip to content

Commit

Permalink
Support wildcards in redirects.
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Nov 28, 2024
1 parent 6dd1f5f commit 97afba2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utilities/data/getStoryblokRedirects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const sanitizeRedirectCode = (code) => {
const sanitizeSourcePath = (str) => {
const parts = str.split('?');
const path = parts[0];
return path;
// Replace '*' with '(.*)' to match dynamic routes
return path.replace(/\*/g, '(.*)');
};

/**
Expand Down

0 comments on commit 97afba2

Please sign in to comment.