diff --git a/projects/wp-multisite-nextjs/src/pages/_sites/[site]/[...path].js b/projects/wp-multisite-nextjs/src/pages/_sites/[site]/[...path].js index 6ac38f24d..103badf48 100644 --- a/projects/wp-multisite-nextjs/src/pages/_sites/[site]/[...path].js +++ b/projects/wp-multisite-nextjs/src/pages/_sites/[site]/[...path].js @@ -54,7 +54,7 @@ export async function getStaticPaths() { // path is the catch all route, so it must be array with url segments // if you don't want to support date urls just remove the date from the path params: { - site: site.host, + site: site?.slug ?? site.host, path: removeSourceUrl({ link, backendUrl: site.sourceUrl }) .substring(1) .split('/'), @@ -75,7 +75,7 @@ export async function getStaticPaths() { return { // path is the catch all route, so it must be array with url segments params: { - site: site.host, + site: site?.slug ?? site.host, path: normalizedLink.substring(1).split('/'), }, }; diff --git a/projects/wp-multisite-nextjs/src/pages/_sites/[site]/index.js b/projects/wp-multisite-nextjs/src/pages/_sites/[site]/index.js index b8868e4ff..078c1949e 100644 --- a/projects/wp-multisite-nextjs/src/pages/_sites/[site]/index.js +++ b/projects/wp-multisite-nextjs/src/pages/_sites/[site]/index.js @@ -63,7 +63,7 @@ export const getStaticPaths = async () => { return { paths: sites.map((site) => ({ params: { - site: site.host, + site: site?.slug ?? site.host, }, })), fallback: true,