Recently wrote a resume display page, showing the user's page is http://xxx.com/?+username, but I see a lot of sites can be directly in the background to specify a level two domain name and then bound, how is it implemented?
Reply content:
Recently wrote a resume display page, showing the user's page is http://xxx.com/?+username, but I see a lot of sites can be directly in the background to specify a level two domain name and then bound, how is it implemented?
Some DNS service providers (such as the domestic famous Dnspod) have API interface, can call interface to add or delete sub-domain name. But it is more convenient to use the pan domain name resolution.
Pan-domain name resolution is to resolve all other domain names (without adding specific records) to an IP.
And then the httpd can also use regular expressions or wildcard characters to map an indeterminate domain name to a site.
Like what:
server { listen 80; server_name *.example.com; root /path/to/root;}
Then PHP will then pass $_SERVER['HTTP_HOST'] to identify the different domain names on the line.