Currently, many websites can assign users a custom second-level domain name, for example, myname.netingcn.com. but the actual access address may be www.netingcn.com/user.php? Uid = myname. To make it work properly, configure wildcard domain name resolution in DSN resolution, and then set rewrtie in the nginx configuration file. Nginx configuration: server {listen80; se
Currently, many websites can assign users a custom second-level domain name, for example, myname.netingcn.com. but the actual access address may be www.netingcn.com/user.php? Uid = myname. To make it work properly, configure wildcard domain name resolution in DSN resolution, and then set rewrtie in the nginx configuration file. The nginx configuration is as follows:
server { listen 80; server_name *.netingcn.com;...if ($host ~* ^(......)\.netingcn\.com) { set $sub_name $1; rewrite ^/ /user.php?uid=$sub_name last;}...
Assume that all the 6-character subdomain names are user-defined domain names and then rewrite them. In addition, you can use the set command to store some information in the expression in a variable and then use it.