Overview - Sub-path routing for locales
What is it?
Sub-path routing for locales means organizing your website URLs so that each language version has its own path segment, like '/en' for English or '/fr' for French. This helps visitors and search engines know which language content to show based on the URL. Instead of switching languages with query parameters or cookies, the language is part of the URL path itself.
Why it matters
Without sub-path routing for locales, users might get confused about which language they are viewing, and search engines may not index the different language versions properly. This can hurt user experience and SEO. Sub-path routing makes language clear and consistent, improving accessibility and helping websites reach a global audience effectively.
Where it fits
Before learning this, you should understand basic Next.js routing and how internationalization (i18n) works in web apps. After mastering sub-path routing, you can explore advanced localization techniques like dynamic content translation, language detection, and server-side rendering for multiple locales.