Created
September 24, 2012 09:02
-
-
Save lukejones/3775027 to your computer and use it in GitHub Desktop.
Multiple development environments within wp-config
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
<? | |
// Database settings | |
switch($_SERVER['SERVER_NAME']) { | |
// Local Environment | |
case 'localhost': | |
define('DB_NAME', 'db_name'); | |
define('DB_USER', 'db_user'); | |
define('DB_PASSWORD', 'db_password'); | |
define('DB_HOST', 'localhost'); | |
break; | |
// Production environment | |
case 'www.domain.com': | |
case 'domain.com': | |
define('DB_NAME', 'db_name'); | |
define('DB_USER', 'db_user'); | |
define('DB_PASSWORD', 'db_password'); | |
define('DB_HOST', 'localhost'); | |
break; | |
} | |
// Authentication key: https://api.wordpress.org/secret-key/1.1/salt/ | |
define('AUTH_KEY', ''); | |
define('SECURE_AUTH_KEY', ''); | |
define('LOGGED_IN_KEY', ''); | |
define('NONCE_KEY', ''); | |
define('AUTH_SALT', ''); | |
define('SECURE_AUTH_SALT', ''); | |
define('LOGGED_IN_SALT', ''); | |
define('NONCE_SALT', ''); | |
// WordPress Database Table prefix. | |
$table_prefix = 'wp_'; | |
// WordPress Localized Language, defaults to English. | |
define('WPLANG', ''); | |
// 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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment