Created
October 22, 2018 11:54
-
-
Save vastus/46b9c26ddc77302a5f9ce7bdf9b5b123 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/* | |
* Getting too many redirects when SSL is not on and the WP_HOME and | |
* WP_SITEURL settings are set. | |
* | |
* These settings should work with CloudFront and a WP instance. | |
*/ | |
$protocol = (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) ? $_SERVER['HTTP_X_FORWARDED_PROTO'] : 'http'; | |
$host = $_SERVER['HTTP_HOST']; | |
$origin = $protocol . '://' . $host; | |
if ($protocol == 'https') { | |
$_SERVER['HTTPS'] = 'on'; | |
} | |
define('WP_HOME', $origin); | |
define('WP_SITEURL', $origin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment