How does php direct different domain names to the same page?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.