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:
I cannot figure out why the dashboard login won't load, and the front end assets only load with http??
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';
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
$_SERVER['HTTPS']='on';
$_SERVER['SERVER_PORT'] = 443;
}
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
I cannot figure out why the dashboard login won't load, and the front end assets only load with http??
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Awesome, glad you have this resolved!
Martin
Martin
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.