diff --git a/src/app/benchmarks/[slug]/[chain]/page.tsx b/src/app/benchmarks/[slug]/[chain]/page.tsx index 320c9686..26df0530 100644 --- a/src/app/benchmarks/[slug]/[chain]/page.tsx +++ b/src/app/benchmarks/[slug]/[chain]/page.tsx @@ -1,5 +1,5 @@ import type { Metadata } from "next"; -import { notFound } from "next/navigation"; +import { notFound, redirect } from "next/navigation"; import Link from "next/link"; import { ArrowLeft, ArrowUpRight } from "lucide-react"; import { getBenchmark } from "@/data/benchmarks"; @@ -326,6 +326,14 @@ export default async function BenchmarkChainPage({ params: Promise; }) { const { slug, chain } = await params; + // 308 non-canonical casings + legacy aliases (e.g. /ETH → /eth, /ton → + // /gram) to the canonical lowercase slug so Google indexes one URL per + // chain. matchesChainSlug() is case-insensitive so both render before + // this redirect — without it, /perp-fees/ETH + /perp-fees/eth both 200 + // and Ahrefs flags the lowercase variants as orphans (parent links use + // the YAML's uppercase value). + const canon = canonicalChainSlug(chain); + if (canon !== chain) redirect(`/benchmarks/${slug}/${canon}`); const data = await loadChainPage(slug, chain); if (!data) notFound(); const { benchmark, explainer } = data; @@ -601,7 +609,7 @@ function SiblingChains({ {siblings.map((c) => (
  • {c.label} diff --git a/src/app/benchmarks/[slug]/page.tsx b/src/app/benchmarks/[slug]/page.tsx index 5f515eea..0a481b45 100644 --- a/src/app/benchmarks/[slug]/page.tsx +++ b/src/app/benchmarks/[slug]/page.tsx @@ -23,6 +23,7 @@ import { SITE } from "@/data/site"; import { buildBreadcrumbJsonLd, buildFaqPageJsonLd, safeJsonLd } from "@/lib/jsonld"; import { buildBenchDatasetJsonLd } from "@/lib/dataset-jsonld"; import { renderTemplate } from "@/lib/bench-template"; +import { canonicalChainSlug } from "@/lib/chain-aliases"; import type { Benchmark } from "@/types/benchmark"; // ISR with a 60 s revalidate window. The page is prerendered by @@ -604,7 +605,7 @@ function PerChainPagesNav({ benchmark }: { benchmark: Benchmark }) { {chains.map((c) => (
  • {c.label}