I am working on complex routing in Next js and I am not able to find a way how can I set up it. In an e-commerce store that is based on the shop and tailormade catalog with USA states(al,ak, az). solutions .So the URL should look like [/usstages/shop/categories] or [/usstages/tailor/categories] and on the home page state is all states, in other words, we can silence the state on the homepage.
Also, the shop is the default option, doesn't want to keep it in the URL. So the actual URL looks like [al/{noshop}/women] or [al/tailor/women].
I would like to create a common routing for this so that we use [ak/women] for the shop but for tailor [al/tailor/women]. Another is on the home page and sates page, both are the page loading. so if we use only states like this [/al] it means a home page with Alabama states products.
So my URL is the followings:
- /al
- /al/tailor
- /al/women
- /al/tailor/women
I create a dynamic root in Next pages/[...slug].js My question: How can I pick data or align url in our code, if the single or double or triple parameters come for states and shop or tailor type are as per the above listing?