Home > Software design >  How to rename parent path in NextJS dynamic routing
How to rename parent path in NextJS dynamic routing

Time:05-19

I’m able to use NextJS dynamic routing to build pages. Currently I have the file structure as photo. The url /apps shows many apps, /apps/123 shows the app detail for a single app.

But I want to turn /apps/123 to /app/123, and keep everything else the same. How to achieve that in NextJS?

Photo of the file structure

CodePudding user response:

You have to rename the folder apps as app. That will change the routes too.

  • Related