Course map
Stage 1: App Router Foundations
Stage 2: The Rendering Model
Stage 3: Data, Caching and Mutations
Stage 4: Full-Stack Next.js
Stage 5: Production and Specialization

Part 02 / Topic 6 of 9

Route groups: (info) to organize without touching the URL

Wrapping a folder's name in parentheses, (info), creates a route group: the folder exists on disk to organize files, but the parentheses are never part of the URL. harness/app/store/(info)/about/page.tsx is /store/about, not /store/info/about — and its sibling, harness/app/store/(info)/contact/page.tsx, is /store/contact, sitting right next to it.

$ curl -s http://localhost:PORT/store/about | grep -o '<main[^>]*>.*</main>'
<main style="font-family:system-ui;padding:2rem;max-width:560px"><h1>About Apna Bazaar</h1><p>Apna Bazaar started as a single stall in Jaipur selling blue pottery, and now ships handmade goods from Jaipur, Varanasi and Chennai across India.</p><p><a href="/store">Back to Apna Bazaar</a></p></main>

$ curl -s -o /dev/null -w "%{http_code}\n" http://localhost:PORT/store/info/about
404

The second command proves the point from the other direction: the literal path /store/info/about, with "info" spelled out, does not exist at all.

Route groups have one sharp edge, and it is worth triggering on purpose rather than reading about it. Two different groups whose contents resolve to the same URL are a build error, not a silent override. Add a second group, (admin)/about/page.tsx, next to the existing (info)/about/page.tsx — both would resolve to /store/about — and the real build fails immediately:

$ npm run build
...
> Build error occurred
Error: Turbopack build failed with 1 error:
./app/store/(info)
Error: You cannot have two parallel pages that resolve to the same path. Please check /store/(admin)/about and /store/(info).

Delete the (admin) group and the build is green again. Exercise 5 has you reproduce this yourself.

Full files: examples/05-about-route-group-page.tsx, examples/06-contact-route-group-page.tsx.

Done here? The practice set for Part 2 — including the solutions — is on the part page.

Search the guide