Multiple pages in multi-tenant architecture using pages folder not working
Answered
Mrigal carp posted this in #help-forum
Mrigal carpOP
I have an old ( v 13 ) multitenant app with pages folder structure.
While building it had single index pages for each domain. Now i want to expand it to more pages for each template and each domain can have blogs. I have created the folder structure as shown in image.
Homepage render domain home page but redirecting to other pages ( blog, about contact etc ) results in 404.
I have shown home page and nav links. Clicking on any link ( apart from home ) results in 404. In my middleware I have given a console log at starting to see what happens on link click. It prints nothing.
Please helo
While building it had single index pages for each domain. Now i want to expand it to more pages for each template and each domain can have blogs. I have created the folder structure as shown in image.
Homepage render domain home page but redirecting to other pages ( blog, about contact etc ) results in 404.
I have shown home page and nav links. Clicking on any link ( apart from home ) results in 404. In my middleware I have given a console log at starting to see what happens on link click. It prints nothing.
Please helo
11 Replies
did you tried using the <Link> tag in the nav link
Mrigal carpOP
Yes
Just now I made some progress. I moved _sites part alone to app folder.
Mrigal carpOP
Answer
Mrigal carpOP
Like this
middleware config
export const config = { matcher: [ "/", "/((?!api/|_next/|_static/|_vercel|[\w-]+\.\w+).*)",
] }
] }
I havent tested rest of the all ( Home and dashboard ). Going to check now.
all the best let me know it worked
Mrigal carpOP
Worked