A domain in Frontic maps a URL (host plus optional path prefix) to a specific scope / region / locale combination. Every Frontic API call carries aDocumentation Index
Fetch the complete documentation index at: https://docs.frontic.com/llms.txt
Use this file to discover all available pages before exploring further.
contextDomain value, and Frontic matches it against the configured domain rows to decide which scope, region, and locale should resolve the response. No match → the project walks its default cascade (default scope → default region → default locale) and the request still succeeds.
Frontic supports any URL strategy you want — country TLDs (demo-shop.de, demo-shop.fr), subdomains (de.demo-shop.com), path prefixes (demo-shop.com/de), or any mix. Pick what your project demands and add a row per scope/region/locale combination.
A typical mapping
| Domain | Scope | Region | Locale |
|---|---|---|---|
demo-shop.com | public | United States (USD) | en |
demo-shop.com/de | public | Germany (EUR) | de |
demo-shop.com/fr | public | France (EUR) | fr |
b2b.demo-shop.com | b2b | North America (USD) | en |
b2b.demo-shop.com/de | b2b | Germany (EUR) | de |


Configuring a domain
Open Settings → Domains and click Add Domain. Each row asks for:- Domain — the host plus optional path prefix (
demo-shop.com,demo-shop.com/de,b2b.demo-shop.com). - Scope — which scope to resolve in.
- Region — one of the scope’s regions.
- Locale — one of the region’s supported locales.
- Alias — optional; an alternative URL that resolves to the same row (see below).
Resolution behaviour
When a request arrives with acontextDomain:
- Frontic looks for the longest matching domain row —
demo-shop.com/detakes precedence overdemo-shop.comfor acontextDomainofdemo-shop.com/de/products/…. - If a row matches (either as the primary domain or via its alias), the request inherits that row’s scope, region, and locale.
- If nothing matches, Frontic walks the default chain: the project’s default scope, then that scope’s default region, then that region’s default locale. The request succeeds with the defaults rather than erroring.
contextDomain is one of two ways context can come in; calls can also carry a contextKey whose own scope/region/locale take precedence over the domain match. See Request Context for the full resolution flow.
What the domain field represents
The “domain” you configure here is the value your app passes ascontextDomain on every Frontic API call. It plays two roles:
- Context resolution — Frontic matches the value against your configured domain rows to decide which scope, region, and locale to apply.
- URL generation — when a Page or a Route field returns a URL for a record, the host portion comes from the matching domain entry.
route.urlandroute.hrefcarry the Frontic domain that resolved.
request.host and you’re done. But it’s a string your app controls, not a captive of the request URL. You can derive contextDomain from anywhere: a header, a routing rule, a feature flag, a user preference. That flexibility is mostly relevant when one (scope, region, locale) triple needs to serve more than one real hostname — see Serving multiple hostnames on one triple below.
Domain aliases
A Domain Alias is an alternative URL that resolves to the same row as the primary domain. Most teams reach for it during local development — your production domain isn’t what your dev server serves. Pointlocalhost:3000 or my.local.test at the production row without creating a duplicate binding:


contextDomain: 'localhost:3000' resolve to the same scope/region/locale as the production domain. One alias per domain row — for more than one alternative URL on the same triple, see Serving multiple hostnames on one triple.
Route fields in the response pick up the alias too. When a request resolves via an alias, the URLs that Route fields produce — on product cards, navigation items, anything that links to a page record — come back with the alias’s host instead of the primary domain. Internal linking on the alias host works without any frontend rewriting.
Interaction with withdrawals and redirects
When a Page record is withdrawn (deleted or unpublished), Frontic can serve the old URL as a302 redirect or a 404 depending on the Page’s withdrawal strategy. See URLs, redirects & SEO — the Page behaviour is orthogonal to domain setup but the two compose: a withdrawal happens at the Page level, domain resolution happens at the URL level.
Serving multiple hostnames on one triple
A single domain row binds one (scope, region, locale) triple, and the resolver doesn’t accept duplicates that would conflict the same triple. When you need more than one real hostname to land on the same triple — staging plus production, multiple regional vanity URLs, dynamic preview hosts — there are two patterns:- Add an Alias to the row — clean when the alternatives are stable and few (production plus
localhost:3000, or one extra vanity URL). One alias per row, set in the Domain Alias field. Route URLs in the response automatically use the alias’s host when traffic comes through it, so internal links stay on the right host without any work in the frontend. - Derive
contextDomainin the app — clean when the set of hostnames is dynamic or numerous (preview deploys, multi-tenant routing, white-labelled subdomains). All callers pass the samecontextDomainvalue to the API regardless of which real hostname served them; every caller gets the same scope/region/locale. Route responses carry the canonical Frontic domain inurlandhref— for internal linking on the alternative hosts, useroute.path(host-relative) so links stay on whatever host the visitor came from.
Related
Scopes
The top of the scope / region / locale hierarchy a domain resolves into.
Regions
Where currency and supported locales are defined per market.
Request Context
The full resolver flow —
contextDomain, contextKey, fallbacks.URLs, redirects & SEO
How domain resolution composes with Page-level withdrawal and
canonical URL handling.