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.

add noindex to all short links (fix #479)

Steven Tey07bf845d1453
diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts
index 3741e262d7..c088b8e68b 100644
--- a/apps/web/app/robots.ts
+++ b/apps/web/app/robots.ts
@@ -14,8 +14,8 @@ export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
- disallow: "/api/",
- allow: "/api/og/",
+ allow: ["/$", "/api/og/"], // allow the home page and the OG image API
+ disallow: "/", // disallow everything else
},
sitemap: `https://${domain}/sitemap.xml`,
};
diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts
index ab7df18fb1..c70f55d8ce 100644
--- a/apps/web/app/sitemap.ts
+++ b/apps/web/app/sitemap.ts
@@ -1,4 +1,3 @@
-import prisma from "@/lib/prisma";
import { SHORT_DOMAIN } from "@dub/utils";
import { MetadataRoute } from "next";
import { headers } from "next/headers";
@@ -12,19 +11,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
domain = SHORT_DOMAIN;
}
- const data = await prisma.domain.findUnique({
- where: {
- slug: domain,
- },
- select: {
- target: true,
- },
- });
-
- if (!data || !data.target) {
- return [];
- }
-
return [
{
url: `https://${domain}`,