---
title: "Discussion on \"Dynamic routes recipes from Next.js App Router\" | Hashnode"
description: "Discussion on \"Dynamic routes recipes from Next.js App Router\". Learn about dynamic routes and other routing essentials from the Next.js App Router in a beginner-friendly way, with many code examples and visuals."
url: "https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Dynamic routes recipes from Next.js App Router](https://blog.greenroots.info/dynamic-routes-nextjs-app-router?utm_source=hashnode&utm_medium=feed)

Learn about dynamic routes and other routing essentials from the Next.js App Router in a beginner-friendly way, with many code examples and visuals.

Nov 9, 2023 · 7 min read · blog.greenroots.info  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#programming](https://hashnode.com/tag/programming)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#tapascript](https://hashnode.com/tag/tapascript)

## Written by

[Tapas Adhikary](https://hashnode.com/@atapas)

@atapas · Bangalore

  
[View profile](https://hashnode.com/@atapas)

Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human

## Responses 7

Markdown supported · ⌘↵ to post

[Sublime ElectronS](https://hashnode.com/@SublimeElectrons)

[Dec 12, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/6578e18680cae6197b6e331e)

I learned a lot again from you Sir Tapas.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Dec 13, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/6578e18680cae6197b6e331e#reply-6579070ea7af0fb6a9056d9d)

Great 👍

[jon](https://hashnode.com/@jonkharel)

[Dec 6, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65702fc2b6f7aea52a52ae52)

good

[Samenu Prices](https://hashnode.com/@fank313)

[Dec 1, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/656a0c504383442536f3477c)

Next.js App Router enhances routing compared to Page Router, offering dynamic route recipes. This improvement allows for more flexibility and efficient navigation, enhancing the overall user experience and developer workflow.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Dec 6, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/656a0c504383442536f3477c#reply-657031d41d5c1b96dc6b617e)

Thanks Warner for commenting.

[Jason Holder](https://hashnode.com/@hengyushen)

[Nov 29, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65671b185d000a04d67bb8b8)

We’re truly amazed at your decoration skills. This looks great!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 29, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65671b185d000a04d67bb8b8#reply-6567644b5d000a04d68018d1)

Thanks a lot.

[Nehal Ingole](https://hashnode.com/@Nehal71)

[Nov 25, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65621f66585e979b362f188c)

Thank for sharing !! Do you have resource to learn about Next.js

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 25, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65621f66585e979b362f188c#reply-6562284a29658b9b067c242a)

Hi Nihal,

I’m making this: Full Stack with NextJS App Router [youtube.com/playlist](https://www.youtube.com/playlist?list=PLIJrr73KDmRwz_7QUvQ9Az82aDM9I8L_8)

[Favourite Jome](https://hashnode.com/@Favourite)

[Nov 23, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/655ecc4b356b1a848aa3df0f)

Thanks for sharing!

I have a question, what if you want a specific dynamic route, like on /a and /b and nothing else?

So if /c is entered you'd go to the 404 page.

I wanted to implement this but couldn't figure it a while back.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 23, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/655ecc4b356b1a848aa3df0f#reply-655ed18c356b1a848aa3df7e)

Hey [Favourit](https://hashnode.com/@Favourite), How are you, man? It's a great question. I can think of two ways(but I haven't found any other direct way yet!)

-   If the routes are specific, then they may not be dynamic. Specific routes can be static and deal with them as the static routes.
    
-   The problem with the first approach is, what if the route segments are way big in number? And What if you do not know about the segments beforehand? In this case, control it at the segment generation level, not the route level. Routing goes by pattern. If the pattern is the same, and for that, you want to opt out of a few segments, take them out in our logic where you generate the segment... Let's say, your dynamic route pattern is /blog/${slug}, in this you want to take /blog/what-a-good-day and /blog/i-am-great but I want to ignore /blog/not-so-great, ignore it USE NEXT.JS MIDDLEWARE. With that you can include named parameters: /about/:path matches /about/a and /about/b but not /about/a/c
    

You can read about them from the middleware doc, and I will also teach these concepts in my nextjs playlist on YouTube :)

[Favourite Jome](https://hashnode.com/@Favourite)

[Nov 23, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/655ecc4b356b1a848aa3df0f#reply-655eff9784fcf8866e4ba116)

I'm doing great [Tapas Adhikary](https://hashnode.com/@atapas)

Yeah, like you mentioned, though I could specify the routes segment by what if they are a large number.

I expected the \[[nextjs.org/docs/app/building-your-application/rou…](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params)\](Generating Static Params) to work.

I'd read more on middleware, thanks. Also, looking forward to the YouTube playlist

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 23, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/655ecc4b356b1a848aa3df0f#reply-655f138084fcf8866e4ba42a)

[Favourite Jome](https://hashnode.com/@Favourite) very cool.. please let me know when you have additional findings on this. Take care.

[Bernardo Gomes de Abreu](https://hashnode.com/@bernardoow)

[Nov 12, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65515c92b114e923524de27f)

Good article!! Thanks for sharing !!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 15, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/65515c92b114e923524de27f#reply-65544f67c5739d38258fea60)

Hey, thanks a lot for reading [Bernardo Gomes de Abreu](https://hashnode.com/@bernardoow).

[Syket Bhattachergee](https://hashnode.com/@syketb)

[Nov 9, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/654c9e603880f1fc0fdb6d3b)

👍 Impressive insights on dynamic routes in Next.js!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 9, 2023](https://hashnode.com/posts/dynamic-routes-nextjs-app-router/654c9783e070fcc3b5804af3/comment/654c9e603880f1fc0fdb6d3b#reply-654ca2774a0606fcdd91fe85)

Thanks a lot :)
