Home › Articles › Reading

December 9, 2024

Designing Multisite Architecture Using Sitecore Headless SXA

One of the challenges in enterprise Sitecore implementations is managing multiple websites without duplicating components, templates and application code.

Consider a global organization operating websites across different countries. Each country requires its own content, language, navigation and regulatory information, while the organization wants to maintain a consistent brand experience.

Sitecore Headless SXA provides a structured approach to addressing these requirements.

However, creating multiple sites in Sitecore is only one part of the solution. The rendering host must also understand which website and content context should be used for every incoming request.


Understanding Headless SXA

Sitecore Experience Accelerator (SXA) provides capabilities for organizing, building and managing multiple websites.

When combined with Headless Services and JSS, it enables developers to use modern frontend frameworks such as Next.js while retaining Sitecore's content management and page composition capabilities.

Headless SXA supports:

  • Multisite content organization.

  • Reusable renderings and templates.

  • Shared datasources.

  • Page designs and partial designs.

  • Site-specific configuration.

  • Cross-site content sharing.

  • Multilingual experiences.

Designing the content structure

Consider an organization operating websites in India, the United Kingdom and the United States.

A simplified Sitecore content structure could look like this:

/sitecore/content
    /GlobalCorporate
        /Shared
            /Data
            /Presentation
        /India
            /Home
            /Data
            /Presentation
            /Settings
        /UnitedKingdom
            /Home
            /Data
            /Presentation
            /Settings
        /UnitedStates
            /Home
            /Data
            /Presentation
            /Settings

In Sitecore 10.3, the top-level grouping is referred to as a tenant. Sitecore 10.4 documentation uses the term site collection.

The Shared site can contain reusable content and presentation assets configured for sharing.

Individual country sites can maintain their own navigation, localized content, legal information and editorial permissions.

The important decision is determining which content should be globally shared and which content should remain under local ownership.

Understanding Site Grouping

Headless SXA provides site definitions through Site Grouping items.

These definitions help establish the appropriate site context when processing requests.

Typical configuration considerations include:

  • Site name.

  • Hostname.

  • Target hostname.

  • Virtual folder.

  • Start item.

  • Language.

  • Environment-specific configuration.

For example:

india.example.com  → corporate-india
uk.example.com     → corporate-uk
us.example.com     → corporate-us

Incorrect or conflicting hostname mappings can cause Sitecore to resolve the wrong website.

The SXA Site Manager is useful for identifying site definition conflicts.

How does Next.js resolve the correct site?

In a shared rendering-host architecture, multiple domains can point to the same Next.js application.

The application must determine the appropriate Sitecore site before requesting layout and content data.

A typical request flow is:

  1. A visitor accesses india.example.com.

  2. Next.js middleware identifies the incoming hostname.

  3. The site resolver determines the corresponding Sitecore site.

  4. The application establishes the site and language context.

  5. JSS retrieves layout data for the resolved site.

  6. Sitecore returns the appropriate page composition and content.

  7. Next.js renders the correct regional experience.

Compatible versions of JSS provide a Next.js Multisite add-on that demonstrates this architecture using middleware, site resolution and page-props plugins.

The exact implementation depends on the JSS version and content delivery architecture.

Understanding site-specific Layout Service requests

For a traditional Sitecore REST Layout Service implementation, the application can supply the site context explicitly.

GET /sitecore/api/layout/render/jss
    ?item=/products
    &sc_site=corporate-india
    &sc_lang=en
    &sc_apikey=YOUR_API_KEY

Two sites may contain the same relative route, such as /products, but return completely different content based on the resolved site context.

This is particularly important when designing routing and caching strategies.

Shared rendering host vs dedicated rendering hosts

A shared Next.js application allows multiple websites to reuse the same component library, routing infrastructure and deployment pipeline.

This approach is useful when sites have similar business requirements, technology stacks and release cycles.

However, sharing a rendering host also introduces a common failure domain. A faulty deployment could affect multiple websites.

Dedicated rendering hosts provide greater deployment independence and operational isolation.

They may be more appropriate when websites have different security requirements, regulatory constraints, release schedules or business-critical workloads.

Reusable components can still be maintained through a shared package or monorepo.

Multisite content management does not require every website to use the same frontend deployment.

Designing reusable presentation

Headless SXA supports presentation reuse through Page Designs and Partial Designs.

A Partial Design can define reusable presentation sections such as headers and footers.

A Page Design can combine Partial Designs to establish the overall presentation structure for a particular page type.

For example, all regional websites can share a common page structure while maintaining country-specific navigation and footer content.

The component implementation remains reusable, while the datasource and site context determine the content displayed.

A practical production scenario

Consider a multisite application where visitors accessing the UK website occasionally receive content intended for India.

The development team confirms that both sites have been configured correctly in Sitecore.

I would investigate:

  • Hostname forwarding through the CDN and reverse proxy.

  • Next.js middleware and site resolution.

  • Site Grouping configuration and hostname conflicts.

  • Site context passed to Layout Service.

  • Language resolution.

  • Next.js and CDN cache keys.

  • Shared component datasource configuration.

One possible cause is that the caching implementation identifies pages only by their relative path.

Both websites may have a /products page, but their content is different.

Caching these pages using the same key can result in cross-site content leakage.

Site identity, language and route must be considered when designing cache isolation.

Architect's takeaway

A multisite architecture is not simply about hosting multiple websites within one Sitecore instance.

It requires a clear strategy for content ownership, component reuse, site resolution, deployment isolation and caching.

Share what genuinely needs to be shared, and isolate what requires independent control.

The objective is to reduce duplication without introducing unnecessary dependencies between websites.

No comments:

Post a Comment