Reputation: 108
I have simple project that when user go to the link like: localhost:3000/course/[id] Then user click join and the url will change to localhost:3000/course/[id]/routeName How can i create folder like that in pages ? Thank you very much!
Upvotes: 1
Views: 917
Reputation: 7889
You want what Next calls 'Multiple dynamic route segments'. Inside of your /pages
directory:
course
[id]
[routeName].js
The path would look like:
/pages/course/[id]/[routeName].js
Upvotes: 1
Reputation: 108
I figured it out ! If you have the same problem like me !
pages
|-categories
|-[category_slug]
|-index.js
|-product
|-[product_slug].js
That's it!
Upvotes: 0