Creating Custom Subdomain

Hi, is it possible to create a custom subdomain with weweb? For example, I want every users to have a custom subdomain for example user1.domain.com, user2.domain.com, and so on. Is it possible and how can I do it?

1 Like

Hi @khairul :wave:

No, we currently can set only one subdomain per project.

It’s a super interesting use case though! May I ask what you would like to build?

I am trying to build an alternative version of shopify, something with a little different approach, if I can make a subdomain for every user/shop that would be great

1 Like

Sounds cool!

Just shared your use case with our product team so they have it in mind :slight_smile:

Is it still the case that you can only publish to one subdomain? Also, what is the process for splitting the app such that some pages go to the domain and others are only applicable to the subdomain?

Yes. There’s definitely no way to publish pages from the same project to different domains at the moment.

To publish the same project on multiple domains, you can’t do it in WeWeb but @jaredgibb shared this resource in a different thread and seemed happy with it!

It’s not affiliated to us and we haven’t tried it so can’t promise anything but perhaps worth a try :slight_smile:

Hello, is there any news here?

I have the same question, but with another usecase: I want to make some sections of a web portal, starting from the 3rd level domain.

4ex: www.domain.com — is an alias of domain.com
business.domain.com — is a part for entrepreneurs.
events.domain.com — events list.

In PHP/Apache it can be done with mod_rewrite, pointing folder /business/ to a subdomain business.

Now we can only build different projects on the same database to implement it.

I have the same requirement for needing custom subdomains and also multiple domains. We built a multi-tenant SaaS application and our clients want to white-label so that their customers stay “within their website” since it is more trusted when the URL in the address bar is recognized by by their users.

Alternative things we have considered (and tried) already:

  1. HTTP redirect: The URL in the address bar changes. Requires URL parameters to handle different tenants. Have to design app without relying/using URL parameters.
  2. Domain forwarding: The URL in the address bar changes. Requires URL parameters to handle different tenants. Have to design app without relying/using URL parameters.
  3. Landing page with tenant selection: Okay for up to 5 tenants. Starts to look like an advertising board with more tenants and their logos displayed.
  4. Domain forwarding with frame redirect: The URL in the address bar stays the same (good). Many other issues with this including CORS, URL parameters don’t work, etc.
  5. Reverse Proxy: Still trying to get this to work. Problem is that all clients may have to learn to set this up themselves, which doesn’t seem like a fun exercise.
  6. https://coalias.com: Debating whether to go this route due to not knowing reputation of the service and what kinds of data is stored/logged.

A couple of members have done this with the help of our office hours at State Change. Weweb is a first class editor but the hosting service is not that sophisticated. Using the self-hosting and code export options that comes with either annual contracts or their enterprise plan lets you host elsewhere that provides these features. Our members chose Digital Ocean, but there are others too!

1 Like

Reverse proxy isn’t so complex when you use nginx, but nginx works good only on Linux configs. You can generate configs and just take care of ssl sertificates.

Of the 6 options you tried, did you choose any? If so, which one was it? I’m looking to build a multi-tenant whitelabel platform and I want to be clear about how I can solve this.

I ended up choosing #3, which was a landing page with a tenant selection.