How does a cloud blog such as wordpress.com bind a domain name?

Source: Internet
Author: User
For example, a wordpress.com or Tumblr user can be bound to a top-level domain name after registration. How can this function be implemented? Because I want to create a cloud Blog like this, I don't know if it is implemented in apache or nginx configuration ?, How does apache Read the Domain Name Information of the database and then, for example, wordpress.com or Tumblr, a user can be bound to a top-level domain name after registration,

How is this function implemented? Because I want to create a cloud Blog like this,

I don't know if it is implemented in apache or nginx configuration ?,
How does apache Read the Domain Name Information of the database and jump to the site under the corresponding user ID?

At the same time, how does one implement routes in the PHP program?

Reply content:

For example, a wordpress.com or Tumblr user can be bound to a top-level domain name of the user after registration,

How is this function implemented? Because I want to create a cloud Blog like this,

I don't know if it is implemented in apache or nginx configuration ?,
How does apache Read the Domain Name Information of the database and jump to the site under the corresponding user ID?

At the same time, how does one implement routes in the PHP program?

First, you need to know what is "Pan resolution ".
Wildcard resolution: * .wordpress.com. In this case, you can resolve the domain name to wordpress.com according to * .wordpress.com, whether you are 1024.wordpress.com or chromefans.wordpress.com.
Then you can judge this "*" in the program. Similar

// Pseudocode $ var = explode ('.', $ _ SERVER ['server _ name']); $ var [0]

The above describes the subdomain method.

The following describes the top-level domain name method.
In fact, the same is true for top-level domain names. In any case, you just need to bind the CNAME to your IP address. Then, you can determine the domain name and check it in the database.

// Pseudocode $ current = $ _ SERVER ['server _ name']; if ($ current! = "Wordpress.com") {// The current incoming domain name is not your domain name is_user_bind_domain ($ current); // is it the user-bound call_something ();}

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.