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, If ($ http_host) == 'www.cypc.com.cn') {header ('location: / cypc / '); Exit ();}?> 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.