platforms icon indicating copy to clipboard operation
platforms copied to clipboard

Steps for setting up custom domains

Open amitav13 opened this issue 1 year ago • 3 comments

Hi, Thanks for the detailed guide! We've got custom subdomains working with this setup. As a next step we wanted to allow our users to use their own domains to host our site on their subdomain, like it's done on the guide for platformize.co. To illustrate:

app.myapp.co - working myuser.myapp.co - working userdomain.com - my user's website xyz.userdomain.com - should point to myuser.myapp.co while keeping xyz.userdomain.com in the URL bar. Need help on this bit

  1. Are there changes to be made to middleware code on our side?
  2. What are the DNS entries we should be instructing our users to add?
  3. Is this setup done somewhere in this repo as well?

We're going to be doing this as a one-off for large clients, so even if it requires code changes/manual steps that's ok with us. Thanks!

amitav13 avatar Apr 20 '23 02:04 amitav13

Hi @amitav13

I'm struggling with this exact setup. I can't get the user subdomain working. I get a 404 DEPLOYMENT_NOT_FOUND. Hopefully this issue gets some traction 🤞 . If you do wind up solving this before anyone responds here, could you post how ya figured it out? Thanks (and I'll do the same!).

babycourageous avatar Apr 21 '23 13:04 babycourageous

I'm getting this issue as well. Will try the newer version and write back.

KyleSau avatar Jul 07 '23 04:07 KyleSau

app.myapp.co - working myuser.myapp.co - working userdomain.com - my user's website xyz.userdomain.com - should point to myuser.myapp.co while keeping xyz.userdomain.com in the URL bar. Need help on this bit

Hey y'all! This exact setup is actually fully supported now with the new version! If you want you can even redirect the myuser.myapp.co subdomain to the custom domain too: https://github.com/vercel/platforms/blob/main/app/%5Bdomain%5D/layout.tsx#L98-L105

Here's the updated guide – feel free to give it a try and let me know if it works

steven-tey avatar Jul 10 '23 18:07 steven-tey