18 lines
546 B
TypeScript
18 lines
546 B
TypeScript
import type { NextRequest } from 'next/server'
|
|
import { resolveCmsRedirect } from '@/lib/cms-redirect'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
export const revalidate = 0
|
|
|
|
export async function GET(request: NextRequest) {
|
|
const pathname = request.nextUrl.pathname
|
|
const normalizedTutorialPage = pathname.match(/^\/Support\/tutorial\/target\/([^/]+)\/p\/\d+\.html$/)
|
|
|
|
return resolveCmsRedirect({
|
|
pathname: normalizedTutorialPage
|
|
? `/Support/tutorial/target/${normalizedTutorialPage[1]}.html`
|
|
: undefined,
|
|
request,
|
|
})
|
|
}
|