Forked from oscarnascimento/gist:17e98e84012e9d11311fea10ff7eda3a
Created
January 29, 2018 16:32
-
-
Save tazeverywhere/a1504da5826dd8852e66f4223f4cc8ab to your computer and use it in GitHub Desktop.
Wordpress wp-config.php MUTIPLE ENVIRONMENT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------------------------ | |
* WORPDRESS MULTIPLE ENVIRONMENT | |
*-----------------------------------------------------------------------------------------*/ | |
//GET HOSTNAME INFO | |
$hostname = $_SERVER['SERVER_NAME']; | |
//VERIFY WHICH ENVIRONMENT THE APP IS RUNNING | |
switch ($hostname) { | |
case 'development.dev': | |
define('WP_ENV', 'development'); | |
define('WP_DEBUG', true); | |
break; | |
case 'staging.mywebsite.com': | |
define('WP_ENV', 'staging'); | |
define('WP_DEBUG', true); | |
break; | |
case 'www.mywebsite.com': | |
define('WP_ENV', 'production'); | |
define('WP_DEBUG', false); | |
break; | |
default: | |
define('WP_ENV', 'production'); | |
define('WP_DEBUG', false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment