0

I'm building a SaaS service, and I want to build a feature for custom domains. For now, my service domain is myservice.com/abc_client_info, I want to change to client_domain.com,/abc_client_info

As I can see Shopify, Github, Bitly, etc. can do it, I just wonder how the mechanism to create that kind of feature.

I don't know how to get the correct Keyword on Google to find a solution for this.

DannyNiu
  • 671
  • 5
  • 21
Mike Nguyen
  • 987
  • 1
  • 10
  • 15

1 Answers1

1

For those familiar with the StackExchange network, one may have already noticed, SE have "custom domains" for various professional topics such as:

  • crypto.stackexchange.com: for cryptography,

  • security.stackexchange.com: for IT security,

  • blender.stackexchange.com: for the Blender 3D creativity software.

Here, "crypto", "security", and "blender" are "sub-domains" of the stackexchange.com domain. Sub-domain is by far the easiest way to host "custom domains", as it doesn't require extra cost to register different "parent" domains.

Shopify, GitHub, etc points certain wild-card subdomains to their particular IP address, and dynamically serve name-based "virtual host" websites as sub-domains are created and retired. These subdomains can be configured at domain registrar website.

What happens behind the scene, is that the web server find matches for wildcard sub-domains and invoke dynamic hosting software (such as CGI scripts, PHP, ASP.NET, JSP, etc.) which are programmed to further differenciate and recognize these subdomains and serve custom contents. The other method is to statically configure each sub-domain in the server configuration (e.g. ServerName in <VirtualHost> block in Apache HTTPD), which provides limited flexibility, but easier to programme for.

DannyNiu
  • 671
  • 5
  • 21