WordPress by default uses a pretty simple test to check if your site is running on https or http . In wp-includes/load.php we find the following method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function is_ssl() { if ( isset( $_SERVER['HTTPS'] ) ) { if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) { return true; } if ( '1' == $_SERVER['HTTPS'] ) { return true; } } elseif ( isset($_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { return true; } return false; } |
In short, if either server variable HTTPS is “on” or “1” or if server variable SERVER_PORT is “443”, assume the site is running on https A sexual […]