I am a front-end and have not been in touch with the background for a long time. today I see two top-level domain names. the entered domain names open the same page, but the address bar has not changed. I don't know how this works, who knows? I am a front-end and have not been in touch with the background for a long time. today I see two top-level domain names. the entered domain names open the same page, but the address bar has not changed. I don't know how this works, who knows?
Reply content:
I am a front-end and have not been in touch with the background for a long time. today I see two top-level domain names. the entered domain names open the same page, but the address bar has not changed. I don't know how this works, who knows?
The two domain names point to the same page (application). In addition to server configuration, you can also setCNAME resolutionSo that access by different domain names has the same effect
For examplenginxService configuration
Server {listen 80; # make the two different domain names have the same access effect server_name www.baidu.com www.godruoyi.com; charset UTF-8; root/data/admin_www/www; location/{index index.html index.htm index. php; if (! -E $ request_filename) {rewrite ^/(. *)/index. php? $1 last ;}} location ~ \. Php $ {fastcgi_pass unix:/dev/shm/php-fpm.sock; # fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME $ request_filename; include fastcgi_params;} error_page 500 502 503 x.html; location =/50x.html {proxy_pass http: // $ host/error/index ;}}
If the server is configured, configure different domain names to direct to the same project.
This is irrelevant to PHP.
Resolve two domain names to the same server on the domain name management console.
The server control can be customized.
The two domain names are bound to the same ip address.
This is configured on the server. like in project deployment, it supports multiple domain names to one