Instantly share code, notes, and snippets.

@grola /config.php
Last active Jan 21, 2018

Embed
What would you like to do?
Cloudflare Flexible SSL for Wordpress
$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