I had the opportunity today to fix a redirection problem on a WordPress blog where an SSL certificate was installed, and the site has therefore switched to HTTPS.
The issue being that WordPress was configured in HTTP and not HTTPS, and when changing the settings to update the URLs, the site is called in HTTPS but it is referencing files in HTTP which are then redirected…
I therefore had an error, a redirection loop. This can happen during a WordPress update, for example.
How to easily fix the problem:
I simply added these lines of code at the very beginning of the config.php file:
define('FORCE_SSL_ADMIN', true); if( strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false ) { $_SERVER['HTTPS'] = 'on'; } |
Since then, everything works perfectly.
Good luck!

Laisser un commentaire