Forked from oscarnascimento/gist:17e98e84012e9d11311fea10ff7eda3a
Created
February 27, 2017 08:09
-
-
Save rolka/b5c37228f0ce56889f39dee7968b73f5 to your computer and use it in GitHub Desktop.
Wordpress wp-config.php MUTIPLE ENVIRONMENT
This file contains hidden or 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