Recall & Review
beginner
What is domain routing for locales in Next.js?
Domain routing for locales lets you serve different languages or regions from different domains or subdomains automatically based on the user's locale.
Click to reveal answer
beginner
How do you configure domain routing for locales in Next.js?
You add a 'domains' array inside the 'i18n' config in next.config.js. Each domain object specifies the domain name and the defaultLocale it serves.
Click to reveal answer
intermediate
Example of a domain configuration for French locale on 'example.fr'?
In next.config.js: { domains: [{ domain: 'example.fr', defaultLocale: 'fr' }] } inside the i18n config.
Click to reveal answer
intermediate
What happens if a user visits a domain not listed in the domain routing config?
Next.js falls back to the default locale and domain specified in the i18n config or redirects based on your setup.
Click to reveal answer
intermediate
Why use domain routing for locales instead of path-based locale routing?
Domain routing provides a cleaner URL without locale prefixes and can improve SEO by targeting specific country domains.
Click to reveal answer
Where do you configure domain routing for locales in Next.js?
✗ Incorrect
Domain routing for locales is set inside the i18n configuration in next.config.js.
What key do you use to specify the domain for a locale in Next.js config?
✗ Incorrect
The key 'domain' specifies the domain name for a locale in the domains array.
If you want 'example.de' to serve German content, how do you specify it?
✗ Incorrect
You specify the domain and defaultLocale like { domain: 'example.de', defaultLocale: 'de' }.
What benefit does domain routing provide over path-based locale routing?
✗ Incorrect
Domain routing gives cleaner URLs without locale prefixes like /en or /fr.
What happens if a user visits a domain not configured for any locale?
✗ Incorrect
Next.js falls back to the default locale if the domain is not configured.
Explain how to set up domain routing for locales in a Next.js project.
Think about where Next.js config lives and how locales are defined.
You got /4 concepts.
Describe the advantages of using domain routing for locales compared to path-based locale routing.
Consider URL appearance and search engine benefits.
You got /4 concepts.