Skip to content

Hosting multiple domains on the same Next.js site (while maintaining multiple languages and SSG)

License

Notifications You must be signed in to change notification settings

tomsoderlund/nextjs-multi-domain-locale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, getStaticProps)), using Next.js’ i18n system.

Demo

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

Concept

  • Domain mapped to Next.js’ i18n locale is used to determine the site.
  • Language is instead handled via a pseudoLocale prop (pages inside a /[pseudoLocale] folder).
  • A redirect from / to /en.
  • TODO: Automatic language detection using the Accept-Language header.

See next.config.js for setup.

About

Hosting multiple domains on the same Next.js site (while maintaining multiple languages and SSG)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published