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 ();}