I am hosting a wordpress site on AWS and am transitioning from http to https. After reading some resources from online I added this line to the wp-config.php
file:
define('FORCE_SSL_ADMIN', true);
Now when i try to access the /wp-admin/
page I get the xx.xx.com redirected you too many times
. The all of the other pages work, it is only the admin panel that is not working.
For anyone coming here like me being behind a reverse proxy that handle the SSL stuff, it took me a while but I could find the documentation where it states what has to be done:
https://codex.wordpress.org/Administration_Over_SSL
It states to add an if in the wp-config:
// 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';
As I don't like to touch the config (mostly because I forget I touched it) I tried to find a more elegant way of doing it:
https://wordpress.org/plugins/ssl-insecure-content-fixer/
I have tried with this plugin and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With