For example, when we access Bing in China, Bing will jump to cn.bing.com. could you tell me: how can we achieve a second-level domain jump for access similar to Bing? For example, if we access Bing in China, Bing will jump to cn.bing.com
Excuse me: how can I achieve access to second-level domain name redirection similar to Bing?
Reply content:
For example, if we access Bing in China, Bing will jump to cn.bing.com
Excuse me: how can I achieve access to second-level domain name redirection similar to Bing?
Many practical solutions ~ Here are two common examples:
In the DNS resolution scheme, many advanced DNS resolutions can be resolved by region (for example, DNSPOD), as long as the resolution of the corresponding region becomes a jump.
The advantage is that it is fast, and the disadvantage is that it is not flexible.
The program judges the source by using the IP address, and then jumps in PHP. it is easy for the IP address to determine the source. many third-party IP interfaces can give the IP address ownership.
The advantage is that it is flexible. The disadvantage is that every request must be sent to the PHP processing area and the performance should be considered.
Server judgment is actually the same as above. Nginx uses scripts to determine the IP attribution and then jumps.
Advantage is fast, disadvantage maintenance is slightly troublesome
Use GeoIP or an existing IP address API library.
Both nginx and php have extensions.