Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit fccb624

Browse files
authored
Merge pull request #638 from 1ifeworld/0xTranqui/241106-redirect
push up redirect
2 parents 31c62c6 + f1755eb commit fccb624

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

apps/site/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Browser
22
NEXT_PUBLIC_GRAPHQL_API=
3-
NEXT_PUBLIC_PRIVY_APP_ID
3+
NEXT_PUBLIC_PRIVY_APP_ID=
44
NEXT_PUBLIC_METADATA_SERVER_URL=
55

66
# Server

apps/site/middleware.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NextResponse } from 'next/server';
2+
import type { NextRequest } from 'next/server';
3+
4+
export function middleware(request: NextRequest) {
5+
const url = new URL(request.url);
6+
7+
// Redirect users visiting river.ph to river.site
8+
if (url.hostname === 'river.ph') {
9+
url.hostname = 'river.site';
10+
return NextResponse.redirect(url);
11+
}
12+
13+
// Allow the request to proceed for other domains
14+
return NextResponse.next();
15+
}
16+
17+
// Apply the middleware to all routes
18+
export const config = {
19+
matcher: '/:path*', // Matches all paths
20+
};

0 commit comments

Comments
 (0)