scusa...
prova ad usare: $_SERVER['HTTP_CF_VISITOR'] o $_SERVER['HTTP_X_FORWARDED_PROTO']
esempi:
Codice PHP:
if ( isset( $_SERVER['HTTP_CF_VISITOR'] ) && strpos( $_SERVER['HTTP_CF_VISITOR'], 'https' ) == false )
{
header( 'HTTP/1.1 308 Permanent Redirect' );
header( 'Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}
o:
Codice PHP:
if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] != 'https' )
{
header( 'HTTP/1.1 308 Permanent Redirect' );
header( 'Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}