Skip to content

Commit

Permalink
lfg
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Oct 27, 2024
1 parent 518b582 commit e007a63
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/(app)/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default function Page({ params }: PageProps) {
notFound()
}

return redirect(`/${originalUrl}`)
return redirect(`/${originalUrl.toLowerCase()}`)
}
14 changes: 14 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -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()
}
10 changes: 10 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e007a63

Please sign in to comment.