Skip to content

Commit 21fc554

Browse files
committed
redirect to blog.daimo.com
1 parent eddcfef commit 21fc554

File tree

1 file changed

+9
-0
lines changed
  • apps/daimo-web/src/app/[...topLevelPage]

1 file changed

+9
-0
lines changed

apps/daimo-web/src/app/[...topLevelPage]/route.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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}`);

0 commit comments

Comments
 (0)