6

Github GitHub - tomsoderlund/nextjs-multi-domain-locale: Hosting multiple domain...

 3 years ago
source link: https://github.com/tomsoderlund/nextjs-multi-domain-locale
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

nextjs-multi-domain-locale

Multiple domains and languages on the same Next.js site

This is an example of hosting multiple domains on the same Next.js site (while maintaining multiple languages and static site generation (SSG)), using Next.js’ i18n system.

https://multi-domain-locale1.vercel.app/

Concept

  • Next.js’ i18n locale is used to determine the site.
  • Selecting a language is instead handled via a pseudoLocale prop (pages in a /[pseudoLocale] folder).
  • A redirect from / to /en.

See next.config.js for setup.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK