Loading style.css and Jquery using HTTPS

Since you are behind a load balancer (confirmed in your comments above), your WordPress installation won’t be able to detect SSL using the is_ssl() function, and will not serve any enqueued scripts or stylesheets with https: protocol URIs.

If you are behind a load balancer that supports the HTTP_X_FORWARDED_PROTO server variable, you can fix your problem by adding this snippet to your wp-config.php file:

// Amazon AWS Elastic Load Balancer, CloudFlare, and some others
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
    $_SERVER['HTTPS']='on';

If you’re unlucky enough to be hosted on Network Solutions, first beat your head against a desk, then try to work this gist into an already-activated plugin (since you can’t activate new plugins because you can’t login to admin): https://gist.github.com/webaware/4688802

Actually, you should be able to force your admin to not use SSL, login, install whatever plugins you need, and then test your installation over SSL to see if all is working, before forcing it to use SSL. Add this to your wp-config.php file, changing WP_SITEURL and WP_HOME to match your real server.

define('FORCE_SSL_LOGIN', false);
define('FORCE_SSL_ADMIN', false);
define('WP_SITEURL', 'http://example.com/');
define('WP_HOME', 'http://example.com/');

Leave a Comment