I want to dynamically create subdomain sites such as "user1.example.com", "user2.example.com" and serve static html and css based on subdomain. For a real world example blogger.com servers html and css for different users on blogspot domainl link https://althouse.blogspot.com/. I want to do exactly the same thing like blogger.com does.
Questions:
- What code do I need to write for determining subdomain (using js). For example user1.example.com the subdomain is user1.
- Should I store user html, css in s3 by creating folders such as user1/, user2/.