How to create a two-level domain name directly on the backend

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.