Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
How can I access to [id]/routeName in Next.js

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!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You want what Next calls 'Multiple dynamic route segments'. Inside of your /pages directory:

  • you want a folder called course
  • inside of that you'd have another folder called [id]
  • inside of that folder, you'd want a file called [routeName].js

The path would look like:

/pages/course/[id]/[routeName].js
about 4 years ago · Juan Pablo Isaza Report

0

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!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!