clean: suppression complète PrestaShop

This commit is contained in:
EduBox Dev
2026-06-20 13:57:37 +00:00
parent 20baf3878f
commit dd49993157
25 changed files with 496 additions and 249 deletions
+3 -21
View File
@@ -1,28 +1,10 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
const MAIN_DOMAIN = process.env.MAIN_DOMAIN || "alfrednobel.edudeploy.com";
export function middleware(req: NextRequest) {
const host = req.headers.get("host") || "";
const cleanHost = host.split(":")[0];
if (cleanHost === MAIN_DOMAIN || cleanHost === `www.${MAIN_DOMAIN}`) {
return NextResponse.next();
}
if (!cleanHost.endsWith(`.${MAIN_DOMAIN}`)) {
return NextResponse.next();
}
const pathname = req.nextUrl.pathname;
const search = req.nextUrl.search;
// Rewrite to the internal proxy API while preserving the original host header
const rewriteUrl = new URL(`/api/proxy${pathname}${search}`, req.url);
return NextResponse.rewrite(rewriteUrl);
export function middleware(_req: NextRequest) {
return NextResponse.next();
}
export const config = {
matcher: ["/((?!api/proxy|api/check-domain|_next|static|favicon.ico).*)",],
matcher: ["/((?!_next|static|favicon.ico).*)"],
};