feat: implement landing page structure with legal pages, footer, CTA, and domain redirection proxy

This commit is contained in:
2026-04-14 10:30:46 +02:00
parent 765eea05f7
commit 383d8484a6
14 changed files with 515 additions and 319 deletions

33
greenlns-landing/proxy.ts Normal file
View File

@@ -0,0 +1,33 @@
import type { NextRequest } from 'next/server'
import { NextResponse } from 'next/server'
const APEX_HOST = 'greenlenspro.com'
const WWW_HOST = `www.${APEX_HOST}`
export function proxy(request: NextRequest) {
const host = request.headers.get('host')
const forwardedProto = request.headers.get('x-forwarded-proto')
if (!host || (host !== APEX_HOST && host !== WWW_HOST)) {
return NextResponse.next()
}
const url = request.nextUrl.clone()
let shouldRedirect = false
if (host === WWW_HOST) {
url.host = APEX_HOST
shouldRedirect = true
}
if (forwardedProto === 'http' || url.protocol === 'http:') {
url.protocol = 'https:'
shouldRedirect = true
}
return shouldRedirect ? NextResponse.redirect(url, 308) : NextResponse.next()
}
export const config = {
matcher: '/:path*',
}