Skip to content

Instantly share code, notes, and snippets.

@sebastian-hsu
Last active August 7, 2017 06:42
Show Gist options
  • Save sebastian-hsu/d0fdc7f4f1b88df0b7dcd76c2f9ead0c to your computer and use it in GitHub Desktop.
Save sebastian-hsu/d0fdc7f4f1b88df0b7dcd76c2f9ead0c to your computer and use it in GitHub Desktop.
wp-config.php HTTPS headers
if (($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] == 'https') || ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
$_SERVER['HTTPS'] = 'on';
}
#If you have blow definition, please change from http to https
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment