This example demonstrates how to use multi-tenancy combined with localization in a single Next.js app powered by Payload CMS.
The app is setup to support different custom domains. Each domain will be parsed to identify the correct tenant and load the relevant localized content.
Next.js rewrites allows the tenant from the request's host header to be extracted and transformed internally.
The app directory matches this structure with nested folders:/app/[tenant]/[locale]/[...slug]
The tenant and locale params are used in the page component to fetch and render the correct localized tenant content.
For a detailed breakdown of the code and setup, checkout the full README in the example root folder.