Skipping subfolder while using Country redirect using Workers

Hello Everyone …!!

I am looking for some help here and will appreciate if anyone could point me in right direction please :slight_smile:

I am trying to use Workers for Country code redirect, which will redirect visitor to respective country TLD domain. I have referred to Country code redirect · Cloudflare Workers docs which is working as expected.

For eg, my domain name is If a visitor from UK browses my website, he should automatically see
This is working very well.

However, the problem is with a few sub-folders (not all), where even they are redirecting.

For eg, is the link of subfolder. Is there any way possible to skip certain subfolders such as /support in this country redirect, so that a person from UK if he accesses main website, he should be able to access, but when accessing subfolder, he should be able to access

Please note, with above workers in place, it changes to and it results in 404 error, as /support resides only on .com website.

Any expert advise please?

Thank you in advance !! cheer!

Was wondering if anyone could help me please?