Different domains with same server and database
-
Hi everyone!
I want to create 2 different websites with WordPress (different domains, same server, same database) and i am having this problem:
I managed to create two different admin interfaces (still no network – which i previously achieved but dont want again for the moment). Each admin for a different site – say http://www.mysite1.com and http://www.websitetwo.net (both on the same server, which is allowed by my host, and both in the same database with different prefixes each for their tables, for example wpS1_ and wpS2_).
I can add content to both sites and put them on line, but the problem is whenever i try to see the final sites (access http://www.mysite1.com or http://www.websitetwo.net from the address bar) i can only see one of them no matter the domain i type!
Indeed, the site displayed will always be the one indicated in index.php (wpS1 or wpS2), which i modified as follows :
/** Loads the WordPress Environment and Template */ require('./wpS1/wp-blog-header.php'); ?>
Thanks to info i found in forums, i also modified my wp-config.php this way:
// table prefix for hosting multiple intalltaions in the same db. switch ($_SERVER[’HTTP_HOST’]) { case “www.mysite1.com”: $table_prefix = “wpS1_’; break; case “www.websitetwo.net”: $table_prefix = “wpS2_’; break; }
Or should i put this?:
// table prefix for hosting multiple intalltaions in the same db. $table_prefix = ereg_replace('^(www\.)', '', $_SERVER['HTTP_HOST']); $table_prefix = ereg_replace('\.', '', $table_prefix); $table_prefix = $table_prefix . '_';
I saw no change really.
As for my General settings in Admin they are set this way:
– WordPress Address (URL): http://www.mysite1.com/wpS1 (or websitetwo.net/wpS2)
– Site Address (URL): http://www.mysite1.com (or websitetwo.net)How can i manage to display both sites on line?
Thanks for your help!
- The topic ‘Different domains with same server and database’ is closed to new replies.