diff --git a/app/(app)/[slug]/page.tsx b/app/(app)/[slug]/page.tsx index 3d93fa71..6f72e7a9 100644 --- a/app/(app)/[slug]/page.tsx +++ b/app/(app)/[slug]/page.tsx @@ -11,5 +11,5 @@ export default function Page({ params }: PageProps) { notFound() } - return redirect(`/${originalUrl}`) + return redirect(`/${originalUrl.toLowerCase()}`) } diff --git a/middleware.ts b/middleware.ts new file mode 100644 index 00000000..f593997d --- /dev/null +++ b/middleware.ts @@ -0,0 +1,14 @@ +import type { NextRequest } from "next/server" +import { NextResponse } from "next/server" + +export function middleware(request: NextRequest) { + const url = request.nextUrl + const lowercasePathname = url.pathname.toLowerCase() + + if (url.pathname !== lowercasePathname) { + url.pathname = lowercasePathname + return NextResponse.redirect(url) + } + + return NextResponse.next() +} diff --git a/next.config.mjs b/next.config.mjs index d007d0d8..a18000b4 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -28,6 +28,16 @@ export default { destination: "/docs/components/layouts/sidebar", permanent: false }, + { + source: "/d/accordion", + destination: "/docs/components/navigation/disclosure-group", + permanent: false + }, + { + source: "/accordion", + destination: "/docs/components/navigation/disclosure-group", + permanent: false + }, { source: "/aside", destination: "/docs/components/layouts/sidebar",