diff --git a/apps/web/pagesAndRewritePaths.js b/apps/web/pagesAndRewritePaths.js index 784e638e63..2ac0cfdd80 100644 --- a/apps/web/pagesAndRewritePaths.js +++ b/apps/web/pagesAndRewritePaths.js @@ -28,7 +28,10 @@ let subdomainRegExp = (exports.subdomainRegExp = getSubdomainRegExp( exports.orgHostPath = `^(?${subdomainRegExp})\\.(?!vercel\.app).*`; let beforeRewriteExcludePages = pages.concat(otherNonExistingRoutePrefixes); -exports.orgUserRoutePath = `/:user((?!${beforeRewriteExcludePages.join("|")}|_next|public)[a-zA-Z0-9\-_]+)`; +exports.orgUserRoutePath = `/:user((?!${beforeRewriteExcludePages + .map((page) => `\\b${page}\\b`) + .join("|")}|_next|public)[a-zA-Z0-9\-_]+)`; + exports.orgUserTypeRoutePath = `/:user((?!${beforeRewriteExcludePages.join( "/|" )}|_next/|public/)[^/]+)/:type((?!avatar\.png)[^/]+)`;