Host 2 domains for the same wordpress database.

Q:Me and a friend are trying to make https://kingphp.com and www.chinascience.org the same… I hosted his domain on my hosting as an add-on domain.

We tried to make the folder he’s hosted in the same folder for my blog, that way both domains opened the same folder/blog.. but all the links in the wordpress blog have the kingphp.com as the website so still, when someone opens any page through his domain, it goes to that page with my domain name.

There’s an option in wordpress to change the blog’s URL… changing it to his makes mine redirects to his, and vicie versa.

$hostname = $_SERVER[‘SERVER_NAME’];
$hostname = str_replace(‘www.’, ”, $hostname);
if ($hostname == ‘medicalpedia.cn’) {
define(‘WP_SITEURL’, ‘http://medicalpedia.cn’);
define(‘WP_HOME’, ‘http://medicalpedia.cn’);
}