I am a front-end, contact background not long time, see today there are two top-level domain names, the input domain name is the same page opened, but the address bar has not changed, do not know what this principle, who knows?
Reply content:
I am a front-end, contact background not long time, see today there are two top-level domain names, the input domain name is the same page opened, but the address bar has not changed, do not know what this principle, who knows?
It's all right upstairs. Two domain names pointing to the same page (app), in addition to the server configuration, can also be set CNAME解析
so that their different domain access has the same effect
nginx
The service configuration such as
server { listen 80; # 这里使两个不同的域名具有同样的访问效果 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 504 /50x.html; location = /50x.html { proxy_pass http://$host/error/index; }}
Server configuration, configure different domains to point to the same project.
This has nothing to do with PHP.
The admin console of the domain name resolves two domain names to the same server.
Server control side can be customized
Two domains bound to the same IP
This is configured on the server, as with the project deployment, support domain name many to one