Next.js › Routing (App/Pages Router)
How is routing in the Pages Router different from the App Router?
BeginnerAnswer
In the Pages Router, each file directly inside the pages folder becomes a route based on its file name, such as pages/about.js becoming the about page, while the App Router instead uses folders with a page.js file inside each one, giving more flexibility for organizing related files like layouts and loading states alongside each route.
// Pages Router
// pages/about.js is accessible at /about
// App Router
// app/about/page.js is accessible at /aboutReal-world example A developer familiar with the older Pages Router notices that the App Router requires an extra folder level for each route, but appreciates being able to colocate loading and error files right next to each page.