This commit is contained in:
Maze Winther
2025-07-16 22:47:17 +02:00
parent e7344d9120
commit accad442f4
5 changed files with 62 additions and 5 deletions
+3 -1
View File
@@ -3,6 +3,8 @@ import type { NextRequest } from "next/server";
import { env } from "./env";
export async function middleware(request: NextRequest) {
const protectedPaths = ["/editor", "/projects"];
// Handle fuckcapcut.com domain redirect
if (request.headers.get("host") === "fuckcapcut.com") {
return NextResponse.redirect("https://opencut.app/why-not-capcut", 301);
@@ -10,7 +12,7 @@ export async function middleware(request: NextRequest) {
const path = request.nextUrl.pathname;
if (path.startsWith("/editor") && env.NODE_ENV === "production") {
if (protectedPaths.includes(path) && env.NODE_ENV === "production") {
const homeUrl = new URL("/", request.url);
homeUrl.searchParams.set("redirect", request.url);
return NextResponse.redirect(homeUrl);