Dynamic route based of path condition
Answered
gin posted this in #help-forum
ginOP
Yo i wanted to know if its possible to render a different route based of the pathname. Example:
i have
i have
domain.com/blog but i can also have domain.com/@ginAnswered by riský
just simply having /blog/page.tsx and then /[yes]/page.tsx would work as dynamic route has lowest pirority
6 Replies
ginOP
can nextjs recognize this or do i have to wrap all the routes inside one handler (i dont want to do this)
just simply having /blog/page.tsx and then /[yes]/page.tsx would work as dynamic route has lowest pirority
Answer
and then if it isnt starting with @ and not there, can just notfound anyway
the other option would be to use nextjs rewrites and detect with starting with
/@ and then go to your page with still a dynamic route@gin thanks
np! enjoy your app building