From 4cc8a6fbf4af38accccf773502274d5cd3152201 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Tue, 20 Jun 2023 15:42:39 +0530 Subject: [PATCH] fix: embed booking 404 (#9652) --- apps/web/next.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index b86bd43e13..c108717e43 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -186,8 +186,9 @@ const nextConfig = { // .* matches / as well(Note: *(i.e wildcard) doesn't match / but .*(i.e. RegExp) does) // It would match /free/30min but not /bookings/upcoming because 'bookings' is an item in pages // It would also not match /free/30min/embed because we are ensuring just two slashes - const userTypeRouteRegExp = `/:user((?!${pages.join("|")})[^/]*)/:type`; - + // ?!book ensures it doesn't match /free/book page which doesn't have a corresponding new-booker page. + // [^/]+ makes the RegExp match the full path, it seems like a partial match doesn't work. + const userTypeRouteRegExp = `/:user((?!${pages.join("|")})[^/]*)/:type((?!book)[^/]+)`; let rewrites = [ { source: "/org/:slug",