Next.js Discord

Discord Forum

Help me, I have problem two parallel pages that resolve to the same path

Unanswered
LaPerm posted this in #help-forum
Open in Discord
LaPermOP
From Image
I want to be selected to be in a certain group. What should I do?

If this is the case, the problem is "You cannot have two parallel pages that resolve to the same path"

8 Replies

please update the thread title; at the current state it is not descriptive of the problem so won't be helpful to prospect helpers
@LaPerm From Image I want to be selected to be in a certain group. What should I do? If this is the case, the problem is "You cannot have two parallel pages that resolve to the same path"
Im not sure what you mean, could you elaborate?

I do understand that you are having a problem with the grouping, reading the nextjs's documentation about it might help you.
https://nextjs.org/docs/app/building-your-application/routing/route-groups
@Pearls Im not sure what you mean, could you elaborate? I do understand that you are having a problem with the grouping, reading the nextjs's documentation about it might help you. https://nextjs.org/docs/app/building-your-application/routing/route-groups
LaPermOP
I'm facing an issue because I have two websites in one project. Therefore, I want to create group routes, but the problem is I want to choose only one group, such as /a1/about or /a2/about. However, the paths must always start with / and not /a1 or /a2...
LaPermOP
Or should I use the rewrite path?
Thats an odd case. first off, i would not recommend creating multiple website in one project.
But if you do decide to do so then you should not use groups but just normal folders and a middleware to rewrite the url:
https://nextjs.org/docs/app/building-your-application/routing/middleware
https://nextjs.org/docs/app/building-your-application/routing/middleware#conditional-statements
@LaPerm Or should I use the rewrite path?
Thats correct yes, even tho i would not recommend creating multiple websites in one project, if you do want to then you would have to rewrite the path.
@LaPerm If you dont need any more help, please mark a solution.