1

I'm building a blogging website where I want the name of the user to be added as a sub-domain dynamically. An example of what I require is shown below.

enter image description here

Since the user decides the blog name, I am neither sure whether I'm supposed to handle this on React or Node, nor how to handle it.

Ibrahim Farooq
  • 408
  • 1
  • 3
  • 14
  • 2
    This has a slightly larger scope because it involves DNS resolution as well. That is, you need to make sure any *.blogg.se subdomains all resolve to the same host. See this thread for a how-to and a discussion of drawbacks: https://serverfault.com/questions/12124/wildcard-dns-and-subdomains And for your React app, you would use the approach discussed here to render dynamically based on the subdomain: https://stackoverflow.com/questions/1201258/how-to-get-a-subdomain-using-window-location – ChiefMcFrank Feb 01 '22 at 23:06
  • Does this answer your question? [Create dynamic subdomains](https://stackoverflow.com/questions/11834403/create-dynamic-subdomains) – holem Oct 13 '22 at 10:51

0 Answers0