Localized SEO route rule | DevPrompt Lab

Use explicit locale routes and translation relationships for canonical and hreflang output.

rule · SEO · intermediate

English Tiếng Việt

A content rule that prevents inferred translations, redirect loops, and indexing of incomplete or thin pages.

Reusable content

Use explicit locale-prefixed routes and canonical URLs from configuration. Resolve a localized resource by its locale and locale-specific slug. Generate hreflang only from stored translations of the same stable resource identity. Never infer a translation from a similar slug. Keep incomplete translations, filtered listings, private pages, and thin coming-soon pages out of the index and sitemap. Map old URLs explicitly, preserve meaningful query parameters, and test permanent redirects for loops and targets.

Published locales: {{LOCALES}}

Legacy route map: {{ROUTE_MAP}}

Translation model: {{TRANSLATION_MODEL}}

How to use it

This rule assumes a stable locale-independent content ID and complete translation rows.

Example

resource_group_id identifies one resource; /en/resources/code-review and /vi/resources/ra-soat-ma both resolve through their translation rows.