put in wp-config.php file if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){ $_SERVER['HTTPS']='on'; }