principlejavascriptModerate
i18n URL Strategy: Subdomain vs Subpath vs ccTLD
Viewed 0 times
i18n URL strategysubdomain localesubpath localeccTLD i18nlocale routingmultilingual URL
Problem
There are three common URL strategies for multilingual sites, each with different SEO, caching, and implementation trade-offs.
Solution
Choose a strategy based on your SEO and infrastructure needs. Subpath (
Subpath: shared domain authority, easiest to implement, same CDN config for all locales.
Subdomain (
ccTLD (
/fr/page) is the recommended default for most projects.// next-intl subpath strategy (recommended)
// Middleware handles: /en/about, /fr/about
// middleware.ts
import createMiddleware from 'next-intl/middleware';
export default createMiddleware({
locales: ['en', 'fr'],
defaultLocale: 'en',
localePrefix: 'always', // or 'as-needed'
});Subpath: shared domain authority, easiest to implement, same CDN config for all locales.
Subdomain (
fr.example.com): separate CDN configs per locale, splits domain authority.ccTLD (
example.fr): strongest geo-signal for local SEO, most expensive, separate domains.Why
Subpath is the simplest strategy and the most compatible with standard hosting. Subdomains and ccTLDs provide geo-targeting signals to Google Search Console but require separate DNS and deployment configuration.
Gotchas
- With
localePrefix: 'as-needed', the default locale has no prefix (/about) — ensure canonical tags are correct to avoid duplicate content. - Subdomain strategy requires CORS configuration if API calls cross subdomains.
- ccTLD requires registering and maintaining separate domain names and SSL certificates.
- Always test redirect chains: a user hitting
/dashboardshould land on/en/dashboard, not a 404.
Revisions (0)
No revisions yet.