Untitled

mail@pastecode.io avatar
unknown
php
3 years ago
826 B
2
Indexable
Never

/**
 * Allow WordPress to detect HTTPS when used behind a reverse proxy or a load balancer
 * See https://codex.wordpress.org/Function_Reference/is_ssl#Notes
 */
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
	$_SERVER['HTTPS'] = 'on';
}

/**
 * Load default configuration for production and staging environment
 */
$common_config = __DIR__ . '/environments/common.php';

if (file_exists($common_config)) {
	require_once $common_config;
}

/**
 * Load configuration for specific environment which is defined in the .env file
 */
$env_config = __DIR__ . '/environments/' . WP_ENV . '.php';

if (file_exists($env_config)) {
	require_once $env_config;
}

Config::apply();

/**
 * Bootstrap WordPress
 */
if (!defined('ABSPATH')) {
	define('ABSPATH', $webroot_dir . '/wp/');
}