Next.js Discord

Discord Forum

Asset prefix for public folder assets?

Unanswered
୧ʕ•̀ᴥ•́ʔ୨ posted this in #help-forum
Open in Discord
So I have several Next projects (in separate repositories) but under the same domain (e.g. domain.com/admin, domain.com/marketing, and others), and it's all rewritten from an empty Vercel project which has the main domain.com assigned (as per this: https://vercel.com/guides/how-can-i-serve-multiple-projects-under-a-single-domain#with-a-proxy-project). Basically requests to /admin go to admin.domain.com, requests to /marketing go to marketing.domain.com, etc.

My issue is that the public folder assets aren't accessible because there doesn't seem to be a way to assign a prefix, the way assetPrefix works for compiled assets. basePath and assetPrefix don't work on public folder. Without a prefix, the browser requests domain.com/image.jpg, and domain.com doesn't know what project to rewrite this to. to Is there a way to add a prefix somehow, maybe a custom config?

0 Replies