This commit is contained in:
hamid zarghami
2026-06-14 11:56:25 +03:30
parent ae59823aa6
commit b7a046f59d
+4 -6
View File
@@ -1,9 +1,11 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server"; import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
// Map host → tenant path // Map host → tenant path
const HOST_MAP: Record<string, string> = { const HOST_MAP: Record<string, string> = {
"avitaprotein.com": "/avita", "avitaprotein.com": "/avita",
"boteflower.ir": "/boote",
"pedarprotein.ir": "/pedar",
// دامنه‌های جدید اینجا اضافه می‌شوند // دامنه‌های جدید اینجا اضافه می‌شوند
}; };
@@ -18,11 +20,7 @@ export function middleware(req: NextRequest) {
const pathname = req.nextUrl.pathname; const pathname = req.nextUrl.pathname;
// مسیرهای api و استاتیک را rewrite نکن // مسیرهای api و استاتیک را rewrite نکن
if ( if (pathname.startsWith("/api") || pathname.startsWith("/_next") || pathname.includes(".")) {
pathname.startsWith("/api") ||
pathname.startsWith("/_next") ||
pathname.includes(".")
) {
return NextResponse.next(); return NextResponse.next();
} }