suggestion for better https support
-
Not all servers set HTTPS like you are trying to detect in 1.2 (and earlier) of super cache.
ie. this is not good enough
if ( isset( $_SERVER[ 'HTTPS' ] ) ) $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'https://'; else $protocol = 'https://';
this is more bullet-proof
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!== 'off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']==443)) { $protocol = 'https://'; } else { $protocol = 'https://'; }
to explain, some setups use port 443 without enabling the HTTPS environment and some actually set HTTPS to ‘1’ and not ‘on’
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘suggestion for better https support’ is closed to new replies.