cliffordp
8/16/2013 - 3:25 PM

wp-config.php conditional for WP Engine Staging Sites *** Must be placed *after* the 'DOMAIN_CURRENT_SITE' constant is defined (near the bo

wp-config.php conditional for WP Engine Staging Sites *** Must be placed after the 'DOMAIN_CURRENT_SITE' constant is defined (near the bottom of wp-config.php)

<?php
# WP Engine Staging Sites Rules

### Must be placed *after* the 'DOMAIN_CURRENT_SITE' (for Multisite) or 'WP_SITEURL' (for non-Multisite) constant is defined (near the bottom of Production Server's wp-config.php)

//Multisite
if( defined('DOMAIN_CURRENT_SITE') && preg_match('/.staging.wpengine.com$/', constant('DOMAIN_CURRENT_SITE')) ) {
//Non-Multisite
//if( defined('WP_SITEURL') && preg_match('/.staging.wpengine.com$/', constant('WP_SITEURL')) ) {

### Enter wp-config.php constants here...

# Turn on WP_DEBUG
  define('WP_DEBUG', true);

}
# End of Staging Site Rules