Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active March 21, 2018 14:31
Copy HTTP_X_FORWARDED_PROTO to HTTPS so WordPress can detect is_ssl()
//copy HTTP_X_FORWARDED_PROTO config to HTTPS var in $_SERVER
if((empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && $_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