
Coding in Public
Jun 9, 2025
Fix Your SEO by Ditching Subdomains for Subfolders with Next.js + Framer
A marketer once asked me to move our site from subdomains to subfolders for SEO. I couldn't figure it out at the time and felt terrible. Here's how I solved it... and why these final integration challenges are what I call the 5% edge.
The "Easy" Solution Trap
Let's talk about how engineers think about "easy" solutions. When you're building a SaaS, the obvious move seems to be: build everything as one app. Marketing pages, authentication, dashboard - all in one Next.js application. Simple, right?
Wrong.
Here's what happens: Your marketing team wants to update the homepage. They come to you. You become the gatekeeper for every single marketing change. Even worse? You start giving non-marketing, data-driven opinions about their copy changes. Trust me, marketers hate this. You've just created a bottleneck that will slow down your entire go-to-market strategy.
The Problem That Stuck With Me
This happened to me. A marketer asked me to move from subdomains to subfolders because subdomains hurt SEO rankings. I eventually figured out how to solve it, but by then we had way too many dependencies built up. The fix was extremely messy - like trying to renovate a house while people are still living in it.
I felt like I'd let the team down by not thinking about this earlier. After I left that company, this problem stuck with me. I was determined never to make this architectural mistake early on again. I spent time figuring out the clean way to do this from the start, because I never wanted a future marketer to have to deal with a messy retrofit.
Finding the 5% Edge
Here's the thing about these integration problems - they're always that last 5% that trips us up. But here's the actual easy solution: Give your marketing team independence with a no-code tool like Framer, then use Next.js rewrites to make it all look like one domain.
Let me show you exactly how I set this up for Respondra:
Marketing site: Built in Framer at respondra.com (marketers can edit freely)
App: Built in Next.js at respondra.com/app
Clean subfolder structure for SEO
The magic happens in your next.config.js
file with rewrite logic. This file is the glue holding everything together - it's the true 5% push that makes the whole system work:
Here's what's happening:
The rewrite rule
/:path((?!app)(?!blog)(?!sitemap.xml)(?!_next).*)
catches any path that's NOT/app
,/blog
,/sitemap.xml
, or/_next
It forwards those requests to
https://www.respondra.com/:path*
(your Framer site)Your Next.js app handles
/app
routes directlyCloudflare points your domain to the Next.js app running on GCP
The Next.js app seamlessly proxies marketing requests to Framer
This configuration file is doing all the heavy lifting, and it's the integration layer that makes everything appear as one cohesive site while keeping your marketing and app completely separate.
The Three Wins
This approach gives you three major advantages:
Your marketing team moves fast without you
Your SEO stays strong with subfolder structure
You focus on building product instead of updating hero sections
At Respondra, my future marketers can update the homepage without ever touching code. I can focus on just building the product.
That's the 5% Edge
The 5% edge isn't just about writing code that works, it's about writing code that works for your entire team. These integration challenges might seem small, but they're often what separates developers who ship successful products from those who get stuck in endless cycles of "almost done."
Sometimes the best solutions come from problems that stick with us. What integration challenge has been nagging at you? The one that seems too small to matter but keeps causing friction? That might be exactly where you need to find your 5% edge.
Have you faced similar integration challenges? I'd love to hear about them. These are the problems that teach us the most about building systems that actually work for real teams.
Blog