Localized Paths: How they work with Rewrites and Custom Headers

Use this guide when your project uses multiple locales and you’re setting up Rewrites or Custom Headers. It covers how localized paths are matched and what to watch for when pages move or slugs change.

Localized paths at a glance

Localized paths are language‑specific prefixes (for example /de, /pt) and localized slugs (for example /blog/hello-world/de/blog/hallo-welt). In Framer, Rewrite and Custom Header rules match the final URL string that visitors see, not an internal page ID. This means the pattern you save must explicitly cover every locale you want to affect, and it will not update automatically if you later move a page or change a localized slug. If you use “expand to all locales,” Framer generates a static pattern based on the locales that exist at save time; add or remove locales later and you should revisit the rule.

How this works with Rewrites and Custom Headers

  • Paths you enter are stored as string patterns; they are not bound to a page ID and won’t auto‑update after moves or slug changes.

  • “Expand to all locales” creates a static pattern for the locales that exist at save time. If locales change later, update the rule and republish.

  • Targets in other projects are also strings. Path changes in the target project won’t sync automatically.

Examples

  • Global header across locales: /*

  • Section header: /(|/de|/pt)/pricing/*

  • Rewrite to external docs: /(|/de|/pt)/docs/*__P0__

  • Per‑locale blog mapping: /de/blog/:sluganother-project/de/blog/:slug

Redirects vs Rewrites (localized)

Redirect targets account for localization, but the source is a plain string. When moving a localized page, consider one of these:

  • Copy the page, then add source expansions

  • Localize source paths based on the destination structure

  • Create one redirect per locale

SEO notes

Set canonical URLs in origin projects to the final domain where pages will be served. Rewrites keep the browser URL on your domain, but canonical tags still help avoid duplicates.

Pitfalls and quick fixes

  • Rule stopped matching after a rename or move → Edit the pattern and republish.

  • Header missing on some locales → Ensure the pattern includes all locale prefixes.

  • Added a new locale → Update patterns or re‑expand and republish.

Updated