Understand language-prefixed routes
A locale that uses a prefix occupies a subdirectory below the site's WordPress home path. For example:
https://example.com/fr/services/
The prefix identifies the locale. The remaining path identifies the canonical WordPress content after its localized segments are resolved.
How prefixes are chosen
POM Translate normally derives a lowercase two-letter prefix from the locale. When several enabled locales share that language, it uses a fuller locale-based value so each route stays distinct. Prefixes are also made unique if a collision remains.
Do not assume that every locale is always represented by its first two characters. Generate links through WordPress or the POM Translate selector and treat those generated addresses as authoritative.
How an incoming request is resolved
For a prefixed request, POM Translate:
- maps the first segment to an enabled locale;
- stores that language as the visitor preference;
- resolves translated post, term, archive, and base segments to a base-language path;
- gives WordPress the query variables for the canonical object;
- compares the requested path with the current localized path;
- sends a 301 redirect when the resolvable path is not canonical.
A request for the bare locale root can resolve to the configured static front page or to the normal posts home.
Preserved URL parts
Generated localized links preserve query strings, fragments, and whether the original path used a trailing slash. Canonical correction also retains the current query string.
Language routing does not take over every request. REST, AJAX, cron, non-GET/HEAD requests, feeds, WordPress administrative endpoints, and paths that look like files are excluded from automatic language redirects.
Verify a prefix
- Open the locale root and a localized singular route.
- Confirm the first path segment matches the selector's generated link.
- Reload with a query parameter.
- Follow one internal link from the page.
- Confirm the request resolves to the same WordPress object as its base-language counterpart.
- Check that a malformed or mixed-but-resolvable form redirects once to the canonical localized address.
For the optional prefix on the base language, see Configure main-language routes.