Skip to content

Commit

Permalink
Merge pull request #638 from 1ifeworld/0xTranqui/241106-redirect
Browse files Browse the repository at this point in the history
push up redirect
  • Loading branch information
0xTranqui authored Nov 6, 2024
2 parents 31c62c6 + f1755eb commit fccb624
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/site/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Browser
NEXT_PUBLIC_GRAPHQL_API=
NEXT_PUBLIC_PRIVY_APP_ID
NEXT_PUBLIC_PRIVY_APP_ID=
NEXT_PUBLIC_METADATA_SERVER_URL=

# Server
Expand Down
20 changes: 20 additions & 0 deletions apps/site/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
const url = new URL(request.url);

// Redirect users visiting river.ph to river.site
if (url.hostname === 'river.ph') {
url.hostname = 'river.site';
return NextResponse.redirect(url);
}

// Allow the request to proceed for other domains
return NextResponse.next();
}

// Apply the middleware to all routes
export const config = {
matcher: '/:path*', // Matches all paths
};

0 comments on commit fccb624

Please sign in to comment.