In nextJS routing is path based for pages but is there anyway to achieve a common route for following:
http://localhost/abc/element/id
http://localhost/abc/def/element/id
http://localhost/abc/def/ghi/element/id
Note how /element/id is common in all
I understand i can make nested folder structure and redirect them to same component but i want to avoid the same as we can further more nesting.
Do take care that you can not use catch all as it should be at the end just before file extension. Also, i don't want to add an extra prefix to the URL as that makes the older url's invalid.