How to make domains find their respective theme?

Hi.
First post from an October newbie here. Sofar, I have managed to setup a multilang, multidomain site (4 domains each with 2 langs). All appears to work fine both online and locally - except that only the theme set as active shows up regardless of domain or language. I do have setup a theme per domain, which works fine when that’s the one set to active.
Wat can I be missing?

Hey @steenih

The Editor can override the active theme for the administrator. Try opening the site in a private session to make sure it works as expected.

Thanks.
Well it works - but only for the session. If I login to the backend via each domain and activate their respective theme in turn, I am pleased to see I can switch freely between domains in the frontend and they do show their proper themes.
But once I’ve closed my Firefox (effectively ending the session), it’s back to normal: all domains showing the same theme.

There are two ways to detect via the hostname/domain, either using the Application URL or matching hostnames.

Can you share how you’ve configured your site definitions?

Please find below data exported from database in yaml format. I have deleted fields assumed to be irrelevant and also shortened the allowed_hosts (some sites have more than one domain pointed at them). I’ve also umitted the remaining two secondary sites - they are setup in exact same way.

Sorry, had to ‘delinksify’ the urls. Real life allowed_hosts do list whichever domain is supposed to point at the site in question.

# patthana_patdb.system_site_definitions
-
  id: 1
  name: "Patthana"
  code: "patda"
  is_custom_url: 1
  app_url: "https-patthana-dk"
  theme: "patbasic"
  locale: "da"
  is_host_restricted: 1
  allow_hosts: "[{Sorry, new users can only put 2 links in a post.}]"
  is_prefixed: 0
  route_prefix: ""
  is_role_restricted: 0
  allow_roles: ""
  is_primary: 1
  is_enabled: 1
  is_enabled_edit: 1
  group_id: 1
-
  id: 2
  name: "Patthana (en)"
  code: "paten"
  is_custom_url: 1
  app_url: "https-patthana-eu"
  theme: "patbasic"
  locale: "en"
  is_host_restricted: 1
  allow_hosts: "[{Sorry, new users can only put 2 links in a post.}]"
  is_prefixed: 1
  route_prefix: "/en"
  is_role_restricted: 0
  allow_roles: ""
  is_primary: 0
  is_enabled: 1
  is_enabled_edit: 1
  group_id: 1
-
  id: 3
  name: "Steenih"
  code: "sihda"
  is_custom_url: 1
  app_url: "https-steenih-dk"
  theme: "sihbasic"
  locale: "da"
  is_host_restricted: 1
  allow_hosts: "[Sorry, new users can only put 2 links in a post.]"
  is_prefixed: 0
  route_prefix: ""
  is_role_restricted: 0
  allow_roles: ""
  is_primary: 0
  is_enabled: 1
  is_enabled_edit: 1
  group_id: 2
-
  id: 4
  name: "Steenih (en)"
  code: "sihen"
  is_custom_url: 1
  app_url: "https-steenih-com"
  theme: "sihbasic"
  locale: "en"
  is_host_restricted: 1
  allow_hosts: "[{Sorry, new users can only put 2 links in a post.}]"
  is_prefixed: 1
  route_prefix: "/en"
  is_role_restricted: 0
  allow_roles: ""
  is_primary: 0
  is_enabled: 1
  is_enabled_edit: 1
  group_id: 2
-

I’ve tried to debug (via phpstorm and xdebug) but things are way too convoluted for this oldschool boy without a clue where to set breakpoints. Perhaps if I got some pointers … preferably just a couple of steps before core considers itself done with connecting theme and incoming url ?

Choosed the solution to move on. Thanks for the free trial.

I can see your allow_hosts has URLs in them. A hostname and a URL are two different things. The list should contain hostnames, for example.

Example of valid hostname

mysite.tld
*.mysite.tld

Example of invalid hostname

https://mysite.tld
https://www.mysite.tld/someplace

BTW - The forum is a casual place to hang out and help each other. If you need official support with getting started, you can email the helpdesk:

Thanks for dropping by!