• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
    • Getting Started with Development
    • Database Architecture
    • Migrations
    • Extending the DB Schema
    • Database Functions
    • Loading data from the DB
    • Writing data to Database
    • Database Webhooks
    • RBAC: Roles and Permissions
    • Marketing Pages
    • Legal Pages
    • External Marketing Website
    • SEO
    • Adding a Turborepo package
    • Adding a Turborepo app

External Marketing Website in the Next.js Supabase Turbo Starter Kit

Learn how to configure Makerkit to work with an external marketing website in the Next.js Supabase Turbo Starter Kit.

Many teams prefer to create an external marketing website for their SaaS application. This allows them to have more control over the design and content of the website. For example, using services such as Framer, Webflow, or Wordpress.

In this case, we have to redirect all marketing pages to the external marketing website. You can do so tweaking the middleware in the apps/web/middleware.ts file.

Take the list of all your marketing pages, and then add a middleware to redirect all those pages to the external marketing website.

tsx
import { NextRequest, NextResponse } from 'next/server';
export function middleware(req: NextRequest) {
if (isMarketingPage(req)) {
return NextResponse.redirect('https://your-external-website.com' + req.nextUrl.pathname);
}
// leave the rest of the middleware unchanged
}
function isMarketingPage(req: NextRequest) {
const marketingPages = [
'/pricing',
'/faq',
'/contact',
'/about',
'/home',
'/privacy-policy',
'/terms-and-conditions',
'/cookie-policy',
];
return marketingPages.includes(req.nextUrl.pathname);
}

Should you add a new marketing page, you need to update the isMarketingPage function with the new page path.