Reputation: 21
I am trying to create a dynamic route in nextjs but I am getting page not found error The page loads only when I give the url with the exact pathname of the page I have a Django Backend server set up I just call The RestApis
Here is the error Error Screen
here is the page when I pass the exact url enter image description here
This is how I created the route in the app directory app/something/[id]
And this is the screen I want to render page.tsx
I am expecting to a dynamic url from where i can extract the id through params
Upvotes: 2
Views: 126
Reputation: 196
Here you are using slug as [id]
So Your URL path should be like this, (1234 will be value of id)
http://localhost:3000/something/1234
instead of this
http://localhost:3000/something/[id]
Reference Link : https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes
Upvotes: 1