fix: Team links and username starting with team rewrites (#9665)
* Fix * Fix private link /book page as wellpull/9675/head
parent
8816a18854
commit
f0f6bd4846
|
@ -188,7 +188,9 @@ const nextConfig = {
|
|||
// It would also not match /free/30min/embed because we are ensuring just two slashes
|
||||
// ?!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)[^/]+)`;
|
||||
const userTypeRouteRegExp = `/:user((?!${pages.join("/|")}$)[^/]*)/:type((?!book)[^/]+)`;
|
||||
const teamTypeRouteRegExp = "/team/:slug/:type((?!book)[^/]+)";
|
||||
const privateLinkRouteRegExp = "/d/:link/:slug((?!book)[^/]+)";
|
||||
let rewrites = [
|
||||
{
|
||||
source: "/org/:slug",
|
||||
|
@ -233,12 +235,12 @@ const nextConfig = {
|
|||
has: [{ type: "cookie", key: "new-booker-enabled" }],
|
||||
},
|
||||
{
|
||||
source: "/team/:slug/:type",
|
||||
source: teamTypeRouteRegExp,
|
||||
destination: "/new-booker/team/:slug/:type",
|
||||
has: [{ type: "cookie", key: "new-booker-enabled" }],
|
||||
},
|
||||
{
|
||||
source: "/d/:link/:slug",
|
||||
source: privateLinkRouteRegExp,
|
||||
destination: "/new-booker/d/:link/:slug",
|
||||
has: [{ type: "cookie", key: "new-booker-enabled" }],
|
||||
},
|
||||
|
@ -293,11 +295,11 @@ const nextConfig = {
|
|||
destination: "/new-booker/:user/:type",
|
||||
},
|
||||
{
|
||||
source: "/team/:slug/:type",
|
||||
source: teamTypeRouteRegExp,
|
||||
destination: "/new-booker/team/:slug/:type",
|
||||
},
|
||||
{
|
||||
source: "/d/:link/:slug",
|
||||
source: privateLinkRouteRegExp,
|
||||
destination: "/new-booker/d/:link/:slug",
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue