I tried changing the base url and base secure url together with base path url and secure base path url but upon changing it from https://test.com/
to https://test.com/sh/shop
it breaks all the pages in the frontend. Any solution for this? Would really appreaciate any help thanks
Got you.
So you want to create a multi site store.
Magento has this feature. You need to create two single store websites in magento admin.
1 will be test.com,
2nd will be test.com/sh/shop.
Check this for details : https://devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html
Base urls of both sites will be different, so this will not cause css issue