Files
avbeat-com/next.config.mjs
Ryan Salazar 585a9503ab homepage: make '/' the canonical route, 301 /home-page → /
Previous state: '/' was 307-redirected to '/home-page', and the
home-page route declared canonical='/home-page'. Net effect on
SEO: Google indexed '/home-page' as the canonical homepage and
treated '/' as a transient redirect (no link equity passed).

Changes:
- next.config.mjs: replace the source:'/' destination:'/home-page'
  temporary redirect with source:'/home-page' destination:'/'
  permanent (301). Any existing crawler entry for /home-page now
  consolidates onto '/'.
- src/app/page.tsx (new): re-exports default + metadata from
  ./home-page/page so '/' serves the homepage directly. No file
  moves required, no relative-import breakage in the home-page
  component subtree.
- src/app/home-page/page.tsx: canonical and openGraph.url
  '/home-page' → '/'. The page still builds at /home-page but
  the 301 above will redirect any hit before render.
- src/app/sitemap.ts: drop the duplicate /home-page entry — Google
  shouldn't be told about a URL that just redirects.
2026-05-21 17:37:45 +00:00

138 lines
3.4 KiB
JavaScript

import { imageHosts } from './image-hosts.config.js';
/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
distDir: process.env.DIST_DIR || '.next',
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
images: {
remotePatterns: imageHosts,
formats: ['image/avif', 'image/webp'],
minimumCacheTTL: 86400,
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
},
// Performance: compress responses
compress: true,
// Performance: power headers for caching static assets
async headers() {
return [
{
source: '/assets/:path*',
headers: [
{ key: 'Cache-Control', value: 'public, max-age=31536000, immutable' },
],
},
{
source: '/_next/static/:path*',
headers: [
{ key: 'Cache-Control', value: 'public, max-age=31536000, immutable' },
],
},
{
source: '/_next/image/:path*',
headers: [
{ key: 'Cache-Control', value: 'public, max-age=86400, stale-while-revalidate=604800' },
],
},
];
},
async redirects() {
return [
// Homepage canonical: '/' is the real route now (src/app/page.tsx
// re-exports from src/app/home-page/page.tsx). The legacy
// /home-page URL gets a 301 permanent redirect to '/' so any
// crawler entry for /home-page consolidates link equity onto
// the canonical root.
{
source: '/home-page',
destination: '/',
permanent: true,
},
// WordPress admin redirects for broadcastbeat.com (301 permanent)
{
source: '/wp-admin',
destination: '/admin',
permanent: true,
},
{
source: '/wp-admin/',
destination: '/admin',
permanent: true,
},
{
source: '/wp-admin/post-new.php',
destination: '/contributor',
permanent: true,
},
{
source: '/wp-admin/edit.php',
destination: '/admin/articles',
permanent: true,
},
{
source: '/wp-admin/profile.php',
destination: '/account',
permanent: true,
},
{
source: '/wp-login.php',
destination: '/client-login',
permanent: true,
},
{
source: '/wp-login.php/:path*',
destination: '/client-login',
permanent: true,
},
// Catch-all for any other wp-admin sub-paths
{
source: '/wp-admin/:path*',
destination: '/admin',
permanent: true,
},
// AV Beat dashboard redirect (avbeat.com/wp-admin/ → unified dashboard)
// These are handled by the same Next.js app when serving avbeat.com
{
source: '/avbeat/wp-admin',
destination: '/admin',
permanent: true,
},
{
source: '/avbeat/wp-admin/',
destination: '/admin',
permanent: true,
},
{
source: '/avbeat/wp-login.php',
destination: '/client-login',
permanent: true,
},
{
source: '/avbeat/wp-login.php/:path*',
destination: '/client-login',
permanent: true,
},
// Login alias — /login redirects to canonical /client-login
{
source: '/login',
destination: '/client-login',
permanent: false,
},
];
}
};
export default nextConfig;