File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
apps/daimo-web/src/app/[...topLevelPage] Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,19 @@ export async function GET(request: Request) {
55
66 // Redirect daimo.xyz to daimo.com
77 if ( url . hostname === "daimo.xyz" ) {
8+ console . log ( `[WEB] redirecting ${ url } to daimo.com` ) ;
89 url . hostname = "daimo.com" ;
910 return Response . redirect ( url , 301 ) ;
1011 }
1112
13+ // Redirect /blog/* to blog.daimo.com
14+ if ( url . pathname . startsWith ( "/blog" ) ) {
15+ const pathname = url . pathname . substring ( "/blog" . length ) ;
16+ const newUrl = new URL ( `https://blog.daimo.com${ pathname } ` ) ;
17+ console . log ( `[WEB] redirecting ${ url } to ${ newUrl } ...` ) ;
18+ return Response . redirect ( newUrl , 301 ) ;
19+ }
20+
1221 // Otherwise proxy the request to our notion super.so
1322 const upstreamUrl = request . url . replace ( url . origin , superSo ) ;
1423 console . log ( `[WEB] proxying ${ request . url } to ${ upstreamUrl } ` ) ;
You can’t perform that action at this time.
0 commit comments