Next.js can't have an /app/index route ?
Unanswered
Channel catfish posted this in #help-forum
Channel catfishOP
I am trying to have a page called index for an index of all my projects, but when I load it defaults to that route automatically.
localhost:3000 -> should go to app/page.jsx
but it defaults to the route that is in app/index/page.tsx
localhost:3000 -> should go to app/page.jsx
but it defaults to the route that is in app/index/page.tsx
4 Replies
@Channel catfish I am trying to have a page called index for an index of all my projects, but when I load it defaults to that route automatically.
localhost:3000 -> should go to app/page.jsx
but it defaults to the route that is in app/index/page.tsx
This is the case for the pages router as well: /…path/index is treated as /…path
It’s kept that way due to historical reasons
So the only way for you is to use something other than “indexâ€
@joulev This is the case for the pages router as well: /…path/index is treated as /…path
Channel catfishOP
Hm, odd. Ok I'll resort to another route title then. Thanks for the help.