domains
This commit is contained in:
+4
-6
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user