Skip to content

Instantly share code, notes, and snippets.

@nb
Created March 30, 2010 12:39
Show Gist options
  • Save nb/349063 to your computer and use it in GitHub Desktop.
Save nb/349063 to your computer and use it in GitHub Desktop.
Using more than one WordPress codebase for multiple installs without symlinks
RewriteEngine On
RewriteBase /baba/
RewriteRule ^$ ../trunk/$1?_config=baba [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ../trunk/$1?_config=baba [L,QSA]
<?php
define('DB_NAME', 'baba');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define( 'ABSPATH', '/www/trunk/');
define( 'WP_SITEURL', 'http://x/baba');
define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/content');
define( 'WP_CONTENT_URL', WP_SITEURL . '/content');
require_once( ABSPATH . 'wp-settings.php' );
<?php
$_configs = array(
'baba' => '/www/baba/baba-wp-config.php',
'dyado' => '/www/dyado/dyado-wp-config.php',
);
if ( isset( $_GET['_config'] ) && isset( $_configs[$_GET['_config']] ) ) {
require_once $_configs[$_GET['_config']];
} else {
die( 'Nothing to see here, move along, move along.' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment