I'm using Magnolia as a headless CMS, with a NextJS app as a frontend. I'm trying to setup the multisite module and I'm having trouble getting it to work.
I have this config.yaml file inside my light module, in decorations/multisite/config.yaml:
sites:
fallback:
cors:
default:
uris:
rest:
patternString: /.rest/*
allowedOrigins:
all: "*"
allowedMethods:
all: "*"
allowedHeaders:
all: "*"
i18n:
class: info.magnolia.cms.i18n.DefaultI18nContentSupport
enabled: true
fallbackLocale: en
locales:
en:
country: ""
enabled: true
language: en
site-a:
mappings:
website:
URIPrefix: ""
handlePrefix: /site-a
repository: website
domains:
site-a:
name: localhost
port: 3000
Basically, I want to serve all content under the “site-a” node under a specific domain (localhost for testing purposes), and I plan on setting up a couple of other sites in the future. However, when I try to edit a page under "site-a", I get a "Oops, the page you have requested is not available.” message from Magnolia and I can’t close the page.
This only happens for pages under "site-a”, so I know for sure it’s related to the multisite setup. It works ok with pages with the “Default” template, but it fails with my custom template:
title: “Custom Template"
baseUrl:
http://localhost:3000
routeTemplate: "/api/preview?slug=/{language}{{@path}}"
$type: siteSpa
Any ideas on what I may be doing wrong here?
Thanks.