Route Groups

In the app directory, nested folders are normally mapped to URL paths. However, you can mark a folder as a Route Group to prevent the folder from being included in the route's URL path.

This allows you to organize your route segments and project files into logical groups without affecting the URL path structure.

Demo1

Demo1: Group routes logically without affecting the URL paths.

Demo2

Demo2: Even in the same level, different layouts can be created.

The naming of route groups has no special meaning. They do not affect the URL path.

Be careful not to resolve to the same URL path. For example, because route groups do not affect the URL path, both (marketing)/about/page.tsx and (shop)/about/page.tsx will resolve to /about, which will cause an error.