Index: wp-config-sample.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-config-sample.php	(revision 52897df8cdb2ab97f3ebd4c4704e38c1fd684f15)
+++ wp-config-sample.php	(revision )
@@ -79,11 +79,6 @@
  */
 define('WP_DEBUG', false);
 
-/* That's all, stop editing! Happy blogging. */
-
 /** Absolute path to the WordPress directory. */
 if ( !defined('ABSPATH') )
 	define('ABSPATH', dirname(__FILE__) . '/');
-
-/** Sets up WordPress vars and included files. */
-require_once(ABSPATH . 'wp-settings.php');
Index: wp-load.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-load.php	(revision 52897df8cdb2ab97f3ebd4c4704e38c1fd684f15)
+++ wp-load.php	(revision )
@@ -23,23 +23,35 @@
 
 error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
 
+$_wp_config_file = '';
 /*
  * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
- * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
+ * doesn't, set the path to wp-config.php. The secondary check for wp-settings.php has the added benefit
  * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
  * and /blog/ is WordPress(b).
- *
- * If neither set of conditions is true, initiate loading the setup process.
  */
 if ( file_exists( ABSPATH . 'wp-config.php') ) {
 
-	/** The config file resides in ABSPATH */
-	require_once( ABSPATH . 'wp-config.php' );
+    $_wp_config_file = ABSPATH . 'wp-config.php';
 
 } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
 
 	/** The config file resides one level above ABSPATH but is not part of another install */
-	require_once( dirname( ABSPATH ) . '/wp-config.php' );
+	$_wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
+
+}
+
+/*
+ * If the path to wp-config.php is set, load it and then load wp-settings.php.
+ *
+ * Otherwise, initiate loading the setup process.
+ */
+if ( '' !== $_wp_config_file ) {
+
+    /** The config file resides in ABSPATH */
+    require_once( $_wp_config_file );
+    /** Sets up WordPress vars and included files. */
+    require_once( ABSPATH . 'wp-settings.php' );
 
 } else {
 
