Skip to content
14 changes: 14 additions & 0 deletions apps/web/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import type { NextConfig } from 'next';

// Old domains that only forward to a site's main domain (a 301 keeps whatever search ranking they had).
// The old domain still needs its DNS records and a bound certificate so the request reaches us.
const LEGACY_DOMAINS: Record<string, string> = {
'swingermatch.com': 'swingandscore.com',
};

const config: NextConfig = {
transpilePackages: ['@whatbox/core'],
output: 'standalone', // small container image for Azure Container Apps
async redirects() {
return Object.entries(LEGACY_DOMAINS).map(([from, to]) => ({
source: '/:path*',
has: [{ type: 'host' as const, value: `(?:www\\.)?${from.replace(/\./g, '\\.')}` }],
destination: `https://${to}/:path*`,
statusCode: 301 as const,
}));
},
};
export default config;
Loading