Created
August 5, 2019 02:35
-
-
Save VirtuBox/0d18a25aa9886df40771e8b8a83931d6 to your computer and use it in GitHub Desktop.
set wordpress siteurl/home variable depending on HTTP_HOST
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
# source : https://github.com/pantheon-systems/WordPress/blob/default/wp-config.php | |
# license : GPL | |
# b2 is (c) 2001, 2002 Michel Valdrighi - [email protected] - | |
if (isset($_SERVER['HTTP_HOST'])) { | |
// HTTP is still the default scheme for now. | |
$scheme = 'http'; | |
// If we have detected that the end use is HTTPS, make sure we pass that | |
// through here, so <img> tags and the like don't generate mixed-mode | |
// content warnings. | |
if (isset($_SERVER['HTTP_USER_AGENT_HTTPS']) && $_SERVER['HTTP_USER_AGENT_HTTPS'] == 'ON') { | |
$scheme = 'https'; | |
$_SERVER['HTTPS'] = 'on'; | |
} | |
define('WP_HOME', $scheme . '://' . $_SERVER['HTTP_HOST']); | |
define('WP_SITEURL', $scheme . '://' . $_SERVER['HTTP_HOST']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment