domains
This commit is contained in:
+4
-6
@@ -1,9 +1,11 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
// Map host → tenant path
|
||||
const HOST_MAP: Record<string, string> = {
|
||||
"avitaprotein.com": "/avita",
|
||||
"boteflower.ir": "/boote",
|
||||
"pedarprotein.ir": "/pedar",
|
||||
// دامنههای جدید اینجا اضافه میشوند
|
||||
};
|
||||
|
||||
@@ -18,11 +20,7 @@ export function middleware(req: NextRequest) {
|
||||
const pathname = req.nextUrl.pathname;
|
||||
|
||||
// مسیرهای api و استاتیک را rewrite نکن
|
||||
if (
|
||||
pathname.startsWith("/api") ||
|
||||
pathname.startsWith("/_next") ||
|
||||
pathname.includes(".")
|
||||
) {
|
||||
if (pathname.startsWith("/api") || pathname.startsWith("/_next") || pathname.includes(".")) {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user