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.

redirect

Steven Teyd47f5c0cef6a
diff --git a/lib/middleware/api.ts b/lib/middleware/api.ts
index 1772b19bc6..94bf1d2aa8 100644
--- a/lib/middleware/api.ts
+++ b/lib/middleware/api.ts
@@ -4,7 +4,13 @@ import { HOME_DOMAIN } from "../constants";
export default async function ApiMiddleware(req: NextRequest) {
const { fullPath } = parse(req);
- if (fullPath.startsWith("/metatags")) {
+ if (fullPath === "/") {
+ return NextResponse.redirect(`${HOME_DOMAIN}/help/article/dub-api`, {
+ status: 301,
+ });
+
+ // special case for metatags
+ } else if (fullPath.startsWith("/metatags")) {
const url = req.nextUrl.searchParams.get("url");
if (!url) {
return NextResponse.redirect(`${HOME_DOMAIN}/metatags`, {