Stupid Wordpress Tricks #1
Our friends over at KizmeTech do an awful lot of Wordpress sites. Here's a simple way to get 2 wordpress sites to use the same underlying database.

Wordpress saves it's configuration data in the MySQL database it uses. I couldn't tell you why you would want to save static data that way, but that's what they do. The name of the wordpress site, actually the URL for the domain all your pages start with, is configured in the Settings->General part of the admin page at the edit field appropriately named 'Blog address'. This field can be overridden in wp-config.php by adding

define('WP_HOME', 'http://secondwordpressinstall.com'); 

Similarly, the URL where the core files reside is set directly above the Blog address at the field 'Wordpress address'. It also can be overridden in wp-config.php by adding

 

define('WP_SITEURL', 'http://secondwordpressinstall.com');

So, do the first wordpress install. Copy that install directory to the place where your second site will reside. Add both overrides to wp-config.h in the second install, substituting the domain you are using for secondwordpressinstall.com, of course. Both sites should provide the same content, and both sets of admin pages work. A useful feature is that if you override a configuration variable this way, it's grayed out in the Settings. Also remember that anything you do change on the admin pages will change for both sites. If you want two different configurations you should probably build two different sites and find a way to mirror the content.

Resources

 

 

 
< Prev

Related Items