http x forwarded
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER[‘HTTP_X_FORWARDED_PROTO’], ‘https’) !== false)
$_SERVER[‘HTTPS’]=’on’;
not needed in htaccess cuz we use nginx
plus its stupid anyway just use 301s in nginx config and wordpress (force https plugin)