The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
/disabled rewrite
Steven Tey654230788055
diff --git a/apps/web/app/[domain]/banned/page.tsx b/apps/web/app/[domain]/banned/page.tsxindex 9c67f90270..2570e5a12c 100644--- a/apps/web/app/[domain]/banned/page.tsx+++ b/apps/web/app/[domain]/banned/page.tsx@@ -24,7 +24,7 @@ export function generateStaticParams() {return [];}-export default function BannedPage() {+export default function BannedLinkPage() {return (<div><Hero>diff --git a/apps/web/app/[domain]/disabled/page.tsx b/apps/web/app/[domain]/disabled/page.tsxnew file mode 100644index 0000000000..5677bfb587--- /dev/null+++ b/apps/web/app/[domain]/disabled/page.tsx@@ -0,0 +1,75 @@+import { BubbleIcon } from "@/ui/placeholders/bubble-icon";+import { ButtonLink } from "@/ui/placeholders/button-link";+import { CTA } from "@/ui/placeholders/cta";+import { FeaturesSection } from "@/ui/placeholders/features-section";+import { Hero } from "@/ui/placeholders/hero";+import { LearnMoreButton } from "@/ui/placeholders/learn-more-button";+import { ShieldSlash } from "@dub/ui";+import { cn, constructMetadata } from "@dub/utils";++export const revalidate = false; // cache indefinitely++export const metadata = constructMetadata({+ title: "Disabled Link",+ description:+ "This link has been disabled. Please contact the owner of this link to get a new one.",+ noIndex: true,+});++const UTM_PARAMS = {+ utm_source: "Disabled Link",+ utm_medium: "Disabled Link Page",+};++export function generateStaticParams() {+ return [];+}++export default function DisabledLinkPage() {+ return (+ <div>+ <Hero>+ <div className="relative mx-auto flex w-full max-w-sm flex-col items-center">+ <BubbleIcon>+ <ShieldSlash className="size-12" />+ </BubbleIcon>+ <h1+ className={cn(+ "font-display mt-10 text-center text-4xl font-medium text-neutral-900 sm:text-5xl sm:leading-[1.15]",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:20px] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ Disabled link+ </h1>+ <p+ className={cn(+ "mt-5 text-pretty text-base text-neutral-700 sm:text-xl",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:10px] [animation-delay:200ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ This link has been disabled. Please contact the owner of this link+ to get a new one.+ </p>+ </div>++ <div+ className={cn(+ "xs:flex-row relative mx-auto mt-8 flex max-w-fit flex-col items-center gap-4",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ <ButtonLink variant="primary" href="https://app.dub.co/register">+ Try Dub today+ </ButtonLink>+ <LearnMoreButton utmParams={UTM_PARAMS} />+ </div>+ </Hero>+ <div className="mt-20">+ <FeaturesSection utmParams={UTM_PARAMS} />+ </div>+ <div className="mt-32">+ <CTA utmParams={UTM_PARAMS} />+ </div>+ </div>+ );+}diff --git a/apps/web/lib/middleware/link.ts b/apps/web/lib/middleware/link.tsindex de89f31a34..1f58c89fc3 100644--- a/apps/web/lib/middleware/link.ts+++ b/apps/web/lib/middleware/link.ts@@ -268,10 +268,11 @@ export async function LinkMiddleware(req: NextRequest, ev: NextFetchEvent) {// handle disabled linksif (disabledAt) {- return NextResponse.rewrite(new URL(`/${domain}/notfound`, req.url), {+ return NextResponse.rewrite(new URL(`/${domain}/disabled`, req.url), {headers: {...DUB_HEADERS,...STATIC_PAGES_CACHE_HEADERS,+ "X-Robots-Tag": "googlebot: noindex",},});}