I’m running a react app with conditional module rendering based on subdomains. Its an eCommerce solution with a customer facing app, admin/backend and a root for our static landing pages.
In order to render the different modules we have a simple window.location.host.split(".") to get the different subdomains ( or root). This works when its published to our domain but raises issues with the random domains provided for the preview apps.
When accessing a subdomain on the preview app Chrome replies with a “connection is not private” error:
"…When Google Chrome tried to connect to admin.my-random-preview.netlify.app this time, the website sent back unusual and incorrect credentials… "
Is there a way to make this work with the “preview app” function, or do I have to setup another domain in order to get a staging site working with subdomains?