问题
How do websites implement extra dots in their url's to point to different resources?
eg. trecoolable.wordpress.com
And how would I be able to implement this if I want different users to have their own unique url when I have one domain name?
回答1:
This is called a sub-domain. You may set it up in your domain name zone (also called DNS settings). This domain zone is available in the account of your DNS provider (Domain Name Registrar or Hosting Provider).
In DNS settings you may, let's say, redirect a sub-domain (blog.yourdomain.com or news.yourdomain.com, etc) to a different URL, connect to a certain website or even point to a different server.
If you want your users to have a unique URL based on your domain name, you will need to point the subdomain name to the IP address of the web-resourse. This can be done with the help of A record in the DNS settings. For example:
youruser.domainname.com - A record (the name of DNS record) - 1.2.3.4 (the IP address of a web-server where the website is hosted. etc)
来源:https://stackoverflow.com/questions/40295826/extra-dot-separations-in-url