Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix 404

Steven Teyf1768b13c821
diff --git a/middleware.ts b/middleware.ts
index 80befefdc7..ca05535c9c 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -34,7 +34,9 @@ export default async function middleware(req: NextRequest, ev: NextFetchEvent) {
const { domain, path, key } = parse(req);
if (isHomeHostname(domain)) {
- return NextResponse.rewrite(new URL(`/dub.co${path}`, req.url));
+ return NextResponse.rewrite(
+ new URL(`/dub.co${path === "/" ? "" : path}`, req.url),
+ );
}
// for public stats pages (e.g. dub.co/stats/github, vercel.fyi/stats/roomGPT)