Next.js Discord

Discord Forum

Next JS 14 Routing

Unanswered
Siricid woodwasp posted this in #help-forum
Open in Discord
Siricid woodwaspOP
Assume I have a file structure as this (I am using app routing with Next 14), app->[id]->test-[slug]

Assume I didn't set the base path. Now assume I want to set the base path as '/test'. In that case, my folder structure will be, app->[slug]

So as you can see now I can't have url like, localhost:3000/1/test/abc as it will be like, localhost:3000/test/abc.

Is there any way I can test my app by adding the [id] to the url with the base path /test? That means I want url to be like localhost:3000/1/test/abc even after setting the basepath. I went through the documentation but didn't find a way, or maybe it is not possible. Any ideas on this>

6 Replies

Siricid woodwaspOP
Thank you for the response.

assume the basePath is '/test'
in that case my file structure starts from [slug]. so my URL will be like localhost:3000/test/abc
but i want my browser url be like localhost:3000/1/test/abc. how can i do that?
Milkfish
Hey Naduni, can you explain in more detail exactly what you're trying to achieve and why? A bit confused by your request