Skip to content

Instantly share code, notes, and snippets.

@harshadyeola
Created February 15, 2016 14:08
Show Gist options
  • Save harshadyeola/71f2c090deee4f56dab7 to your computer and use it in GitHub Desktop.
Save harshadyeola/71f2c090deee4f56dab7 to your computer and use it in GitHub Desktop.
if ( ! defined( 'WP_HOME' ) ) {
$protocol = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ) ? 'https' : 'http';
define( 'WP_HOME', $protocol . '://' . $_SERVER['SERVER_NAME'] );
}
if ( ! defined( 'WP_SITEURL' ) ) {
define( 'WP_SITEURL', WP_HOME . '/wordpress' );
}
define('WP_CONTENT_DIR', dirname(__FILE__) . '/htdocs/wp-content');
if ( ! defined( 'WP_CONTENT_URL' ) ) {
define('WP_CONTENT_URL', WP_HOME . '/wp-content');
}
if (getenv('WP_ENV') != false) {
// Filter non-alphabetical characters for security
#echo "inside if";
define('WP_ENV', preg_replace('/[^a-z]/', '', getenv('WP_ENV')));
}
include 'wp-config.' . WP_ENV . '.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment