Last active
January 21, 2018 17:24
-
-
Save grola/36138d483c12cc9d7c2c9442a740abf7 to your computer and use it in GitHub Desktop.
Cloudflare Flexible SSL for Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$https_options = array( 'HTTP_CF_VISITOR', 'HTTP_X_FORWARDED_PROTO' ); | |
foreach ( $https_options as $https_option ) { | |
if ( isset( $_SERVER[ $https_option ] ) | |
&& ( strpos( $_SERVER[ $https_option ], 'https' ) !== false ) | |
) { | |
$_SERVER[ 'HTTPS' ] = 'on'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment