Skip to content

Instantly share code, notes, and snippets.

@AtsushiA
Created September 19, 2016 16:49
Show Gist options
  • Save AtsushiA/761e94cdf530bce068d508c2dccda06f to your computer and use it in GitHub Desktop.
Save AtsushiA/761e94cdf530bce068d508c2dccda06f to your computer and use it in GitHub Desktop.
WordPress Detect if SSL is used. This is required since we are terminating SSL either on CloudFront or on ELB
/** FIX Redirect loop (add wp-config.php)
Detect if SSL is used. This is required since we are terminating SSL either on CloudFront or on ELB
**/
if (($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] == 'https') OR ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
{$_SERVER['HTTPS']='on';}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment