SEO
This commit is contained in:
21
greenlns-landing/app/de/[slug]/page.tsx
Normal file
21
greenlns-landing/app/de/[slug]/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { notFound, permanentRedirect } from 'next/navigation'
|
||||
import { getGermanSeoPageBySlug, germanSeoPageSlugs } from '@/lib/seoPages'
|
||||
|
||||
type GermanSeoRouteProps = {
|
||||
params: Promise<{ slug: string }>
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return germanSeoPageSlugs.map((slug) => ({ slug }))
|
||||
}
|
||||
|
||||
export default async function GermanSeoRoute({ params }: GermanSeoRouteProps) {
|
||||
const { slug } = await params
|
||||
const profile = getGermanSeoPageBySlug(slug)
|
||||
|
||||
if (!profile) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
permanentRedirect(`/${slug}`)
|
||||
}
|
||||
5
greenlns-landing/app/de/page.tsx
Normal file
5
greenlns-landing/app/de/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { permanentRedirect } from 'next/navigation'
|
||||
|
||||
export default function GermanHomeRedirect() {
|
||||
permanentRedirect('/')
|
||||
}
|
||||
Reference in New Issue
Block a user