Using PHP's Header Function to implement Apache's virtual host technology

xiaoxiao2021-03-06  54

There is a domain name www.cTgpc.com.cn, and another domain name www.cypc.com.cn wants to point to the same machine, DNS has been set up, in addition to using Apache-based virtual host method, you can use PHP HEADER function implementation.

Edit the index.php of www.ctgpc.com.Php, plus the following statement in front, This When you type www.cypc.com.cn in your browser, DNS will point to the IP address of www.ctgpc.com.cn, then INDEX.PHP will execute, When the above statement is performed, the user will transfer the request for www.cypc.com to the path to path / CYPC, so that access to www.cypc.com is implemented. Note: It is recommended to set up a virtual directory (using alias in apache's httpd.conf) so that the two websites can be stored separately and can be backed up separately.

转载请注明原文地址:https://www.9cbs.com/read-109679.html

New Post(0)