Debug is throwing...
Notice: Undefined index: HTTPS in C:\\xampplite\\htdocs\\testsite\\wp-content\\themes\\mytheme\\header.php on line 4
Some servers simply don't set $_SERVER['HTTPS'] if the request is non-secure. Some others may set it to 'off'
. You'll have to check it like this:
if ( isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on" ) {
$pageURL .= "s";
}
Notice: Undefined index: HTTPS
says that HTTPS
is not a key within the $_SERVER
array. It doesn't exist, so you can't compare it with "on"
.
isset()
checks whether a variable is "set" or even available for reference in this case. This would be the best choice in your case.