NextJs Amplify Domain Routing not working

Viewed 204

I have setup NextJs Domain Routing for multiple domains/languages, and all works fine on localhost, and using a vhost modifier in Chrome to test the different domains. I can see the html lang tag change to each locale.

However when built using Amplify, only the default Locale is used, and never changed when i change to domain.

At a loss as what else to try.

next.config.js

module.exports = {
  i18n: {
    localeDetection: false,
    locales: ["en-US", "en-GB", "en-AU", "fr-FR"],
    defaultLocale: "en-GB",

    domains: [
      {
        domain: "dev.***.co.uk",
        defaultLocale: "en-AU",
      },
      {
        domain: "***.com",
        defaultLocale: "en-US",
      },
      {
        domain: "***.co.uk",
        defaultLocale: "en-GB",
      },
      {
        domain: "localhost",
        defaultLocale: "fr-FR",
      }
    ],
  },
  trailingSlash: true,
  images: {
    domains: [
      "***",
    ],
  },
};

Has anyone successfully got Domain Routing to work with Amplify?

0 Answers
Related