Skip to content

Instantly share code, notes, and snippets.

@nielslange
Last active July 1, 2022 18:12
Show Gist options
  • Save nielslange/8098947dea4dead31322 to your computer and use it in GitHub Desktop.
Save nielslange/8098947dea4dead31322 to your computer and use it in GitHub Desktop.
Common wp-config.php
<?php
switch ($_SERVER['HTTP_HOST']) {
case 'dev.mydomain.com':
define('DB_NAME', '' );
define('DB_USER', '' );
define('DB_PASSWORD', '' );
define('DB_HOST', '127.0.0.1' );
define('WP_CACHE', false);
define('WP_DEBUG', true);
define('WP_HOME', 'http://dev.mydomain.com' );
define('WP_SITEURL', 'http://dev.mydomain.com' );
break;
case 'staging.mydomain.com':
define('DB_NAME', '' );
define('DB_USER', '' );
define('DB_PASSWORD', '' );
define('DB_HOST', '127.0.0.1' );
define('WP_CACHE', true);
define('WP_DEBUG', true);
define('WP_HOME', 'http://staging.mydomain.com' );
define('WP_SITEURL', 'http://staging.mydomain.com' );
break;
default:
define('DB_NAME', '' );
define('DB_USER', '' );
define('DB_PASSWORD', '' );
define('DB_HOST', '127.0.0.1' );
define('WP_DEBUG', false);
define('WP_HOME', 'http://www.mydomain.com' );
define('WP_SITEURL', 'http://www.mydomain.com' );
}
# Database and Server Configuration
define('AUTOSAVE_INTERVAL', 300);
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_unicode_ci');
define('DISABLE_WP_CRON', false);
define('DISALLOW_FILE_MODS', false);
define('DISALLOW_FILE_EDIT', false);
define('EMPTY_TRASH_DAYS', 5);
define('FS_METHOD', 'direct');
define('FS_CHMOD_DIR', 0775);
define('FS_CHMOD_FILE', 0664);
define('FORCE_SSL_LOGIN', false);
define('WP_AUTO_UPDATE_CORE', true);
define('WP_MAX_MEMORY_LIMIT', '256M');
define('WP_MEMORY_LIMIT', '256M');
define('WP_POST_REVISIONS', 20);
$table_prefix = 'md_';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment