Created
November 16, 2020 18:31
-
-
Save pappu687/ae5d4eaf0cee2627b9ac16d440efd3f0 to your computer and use it in GitHub Desktop.
WP-CONFIG modifications for Wordpress sites behind EC2 Application Load Balancer. Fixes the redirect loop when trying to access /wp-admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('FORCE_SSL_ADMIN', true); | |
if ( (isset($_SERVER['HTTP_X_FORWARDED_PORT'] ) && ( '443' == $_SERVER['HTTP_X_FORWARDED_PORT'] )) | |
|| (isset($_SERVER['HTTP_CF_VISITOR']) && $_SERVER['HTTP_CF_VISITOR'] == '{"scheme":"https"}')) { | |
$_SERVER['HTTPS'] = 'on'; | |
} | |
/** | |
* Rest of the wp-config.php below. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment