Skip to content

Commit b4e5060

Browse files
committed
fix(shortlink): remove isHosted guard from redirects, not available at build time on ECS
1 parent 86ca984 commit b4e5060

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

apps/sim/next.config.ts

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NextConfig } from 'next'
22
import { env, getEnv, isTruthy } from './lib/core/config/env'
3-
import { isDev, isHosted } from './lib/core/config/feature-flags'
3+
import { isDev } from './lib/core/config/feature-flags'
44
import {
55
getFormEmbedCSPPolicy,
66
getMainCSPPolicy,
@@ -306,32 +306,12 @@ const nextConfig: NextConfig = {
306306
}
307307
)
308308

309-
// Only enable domain redirects for the hosted version
310-
if (isHosted) {
311-
redirects.push(
312-
{
313-
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
314-
destination: 'https://www.sim.ai/$1',
315-
permanent: true,
316-
has: [{ type: 'host' as const, value: 'simstudio.ai' }],
317-
},
318-
{
319-
source: '/((?!api|_next|_vercel|favicon|static|ingest|.*\\..*).*)',
320-
destination: 'https://www.sim.ai/$1',
321-
permanent: true,
322-
has: [{ type: 'host' as const, value: 'www.simstudio.ai' }],
323-
}
324-
)
325-
}
326-
327-
// Beluga campaign short link tracking
328-
if (isHosted) {
329-
redirects.push({
330-
source: '/r/:shortCode',
331-
destination: 'https://go.trybeluga.ai/:shortCode',
332-
permanent: false,
333-
})
334-
}
309+
// Beluga campaign short link tracking (always registered — harmless for self-hosted)
310+
redirects.push({
311+
source: '/r/:shortCode',
312+
destination: 'https://go.trybeluga.ai/:shortCode',
313+
permanent: false,
314+
})
335315

336316
return redirects
337317
},

0 commit comments

Comments
 (0)