Next.js Discord

Discord Forum

Help with routes

Unanswered
American Crocodile posted this in #help-forum
Open in Discord
Avatar
American CrocodileOP
Hey everyone, i have the following routes:

company/edit/[id]/edit/[id]

and basically i want to make it so if no if provided after the first rout it goes to the company/edit page. This route has a page.tsx, but it keeps returning 404.

5 Replies

Avatar
American CrocodileOP
bump
Avatar
you can check if there is an "[id]". If not, call the notFound() function. Else show the specific page for the id
Avatar
American CrocodileOP
the thing is i want to show the page in the edit, but for some reason nextjs is returning route not found
I want it to go into the route that's the thing
Avatar
please share your file structure