Is it possible to redirect from subfolder to subdomain?

I was wondering if it is possible to set redirects from a subfolder (ie. domain.com/sample) to a subdomain (ie. sub.domain.com) which is NOT hosted in Shopify but in Gatsby Cloud?

I bought a third party domain and not transferred it to Shopify and I have created a page hosted on Gatsby cloud using a subdomain.

I would like to redirect my customers accessing to a specific URL (subfolder) to that page.

Can I do that on shopify? or should I set it up on a third domain hosting service?