Link to home
Start Free TrialLog in
Avatar of kenjpete
kenjpete

asked on

Problem with WordPress using HTTPS

I have a WordPress site on a Windows server using IIS, that is using an HTTPS address served from our load balancer. When the site was using just http and no load balancer, it worked fine. Now, none of my stylesheets or other assets are loading on the front end (they say http instead of https), and when I try to login to the WordPress dashboard (wp-admin), I get an error that says the site "redirected too many times".

I have updated the site and WordPress URLs to HTTPS in my WP database. And, I have tried adding various code to my wp-config.php file, along with some rewrite rules to my web.config file but nothing seems to work.

Here are the various lines of code I have tried in my wp-config.php file:

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';

Open in new window


if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
	 $_SERVER['HTTPS']='on';
	 $_SERVER['SERVER_PORT'] = 443;
}

Open in new window


define('FORCE_SSL_ADMIN', true);

Open in new window

define('FORCE_SSL_LOGIN', true);

Open in new window


I cannot figure out why the dashboard login won't load, and the front end assets only load with http??
Avatar of Martin Miller
Martin Miller
Flag of United States of America image

You may have two problems...

Can you isolate to one? e.g.

-  let HTTP: pass through the load balancer to HTTP on your WordPress site?

Then you can confirm pass through with HTTP works with WordPress.

After that you can may one change at a time for HTTPS/SSL, like terminate SSL on the load balancer and use HTTP to WordPress.
Avatar of kenjpete
kenjpete

ASKER

I'm not sure I fully understand what you are suggesting, but I don't have access to the load balancer on our network. Is there anything I can do from the WordPress side to isolate the problem?
ASKER CERTIFIED SOLUTION
Avatar of Martin Miller
Martin Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome, glad you have this resolved!

Martin