--- wp-config.php +++ wp-config.php @@ -86,5 +86,24 @@ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); + +/** Run 2 copies of WordPress from the same Database + * + * source: http://codex.wordpress.org/Running_a_Development_Copy_of_WordPress#Run_2_Copies_of_WordPress_from_the_same_Database + */ +function WP_LOCATION () { + $script_path = realpath(dirname($_SERVER['SCRIPT_FILENAME'])); + $wp_base_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR); + $web_subfolder = substr( $script_path, strlen($wp_base_path)); + $wp_path = $web_subfolder ? substr( dirname($_SERVER['SCRIPT_NAME']), 0, -strlen($web_subfolder) ) : dirname($_SERVER['SCRIPT_NAME']) ; + $retval = 'http' . ($_SERVER['HTTPS'] ? 's' : null) . '://' . $_SERVER['HTTP_HOST'] . $wp_path ; + return $retval; +} +$wpLocation = WP_LOCATION(); +define('WP_HOME',$wpLocation); +define('WP_SITEURL',$wpLocation); +define('WP_CONTENT_URL',$wpLocation."/wp-content"); + + /** Sets up WordPress vars and included files. */