Subdomain: the /regions redirect keeps a page-address base intact (it was joining '/?tab=' onto it)

This commit is contained in:
doxa-maps 2026-09-29 00:23:58 +00:00
parent f3e4623216
commit f837b43609

View file

@ -51,8 +51,14 @@ const marketingRouteRules = Object.fromEntries(
const LEGACY_REGIONS_PAGE = false
// The subdomain branch: the Regions view lives on the gallery's own subdomain; ?lang carries the locale.
const REGIONS_GALLERY_URL = (process.env.NUXT_PUBLIC_RESEARCH_GALLERY_URL || 'https://research.nuxtbase.app').replace(/\/+$/, '')
const regionsTarget = (prefix: string) =>
`${REGIONS_GALLERY_URL}/?tab=regions-dashboard${prefix ? `&lang=${prefix.replace(/^\//, '')}` : ''}`
// Built with URL, not by joining strings: the base can be a bare host (https://research.<host>) or a page
// address (…/doxa-maps-spa/index.html, as on a laptop), and a joined "/?tab=" breaks the second.
const regionsTarget = (prefix: string) => {
const u = new URL(REGIONS_GALLERY_URL)
u.searchParams.set('tab', 'regions-dashboard')
if (prefix) u.searchParams.set('lang', prefix.replace(/^\//, ''))
return u.toString()
}
const regionRouteRules = Object.fromEntries(
MARKETING_LOCALE_PREFIXES.flatMap(prefix => [
LEGACY_REGIONS_PAGE