Next.js Discord

Discord Forum

Having multiple not-found pages in Next15 App dir

Unanswered
Goldstripe sardinella posted this in #help-forum
Open in Discord
Avatar
Goldstripe sardinellaOP
Im trying to make a not-found page for different layouts in next 15 App directory but I keep seeing the root layout's not found component. only. My file tree looks something like this:

 
 /app
 |- layout.tsx
 |- page.tsx
 |- not-found.tsx
 |- /about
    |- layout.tsx
    |- page.tsx
    |- not-found.tsx
 |- /info
    |- layout.tsx
    |- page.tsx 
    |- not-found.tsx


(if neccessary, ask me to share the contents in these files tho i dont think they're much important since it's just simple contents inside them).

# ISSUE
When I'm in a path lets say about/randompage or info/randompage it shows me the Root layout's not-found component instead of the about one or info one depending on the path.

# What im trying to achieve
I want to make the not-found components work for the different routes.

1 Reply

Avatar
Goldstripe sardinellaOP
also, please ping me I do not mind if i get @mentioned.