Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ const nextConfig: NextConfig = {
images: {
remotePatterns: [{ protocol: "https", hostname: "**" }],
},
// Permanent redirect: www.crawlproof.com → crawlproof.com (308 preserves
// the HTTP method and body, making it the correct choice for permanent moves
// on non-GET requests as well as GET).
async redirects() {
return [
{
source: "/:path*",
has: [{ type: "host", value: "www.crawlproof.com" }],
destination: "https://crawlproof.com/:path*",
permanent: true, // emits 308
},
];
},
};

export default nextConfig;
5 changes: 4 additions & 1 deletion proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export async function proxy(request: NextRequest) {
const url = request.nextUrl.clone();
url.pathname = "/login";
url.searchParams.set("redirect", path);
return NextResponse.redirect(url);
// 302 (Found) — temporary redirect: the resource exists but the user must
// authenticate first. Using an explicit status avoids relying on the
// Next.js default and keeps caches from storing the redirect permanently.
return NextResponse.redirect(url, 302);
}

return trackReferralCode(request, response as any);
Expand Down
Loading