Next.js Discord

Discord Forum

I can't access the page.

Unanswered
Red-cockaded Woodpecker posted this in #help-forum
Open in Discord
Red-cockaded WoodpeckerOP
I simply create a page called ProfileClient. With next the routing system makes the page do the routing automatically. But when I want to access this page directly via my localhost:3000/ProfileClient, the error 404 not found is returned

17 Replies

Asian black bear
Show us your folder hierarchy where you created the page file.
@Asian black bear Show us your folder hierarchy where you created the page file.
Red-cockaded WoodpeckerOP
hy, thank you, my hierarchy is : pages->settings->profile-client.tsx
@Asian black bear Show us your folder hierarchy where you created the page file.
Red-cockaded WoodpeckerOP
you don’t need the pages directory
Red-cockaded WoodpeckerOP
really?
or settings probably
Asian black bear
You are mixing routing of the pages router and the app router
^^ yeah
make a folder inside of the app directory called ProfileClient
and then in that folder make a page.tsx
and then it’ll work
Red-cockaded WoodpeckerOP
isimply delete the pages folder
https://nextjs.org/docs/app/building-your-application/routing/defining-routes you can look at the docs for reference on how the app router file structure works
Red-cockaded WoodpeckerOP
ok thank you
so I delete the pages folder, and I name my file profile-client.tsx page.tsx in the settings folder
if you specifically want it to be localhost:3000/ProfileClient then you should rename the settings folder to ProfileClient