Created
April 26, 2017 14:43
-
-
Save johnnypea/73c25364f22fde36b6750ade1097e665 to your computer and use it in GitHub Desktop.
WordPress wp-config.php customization for multiple domains
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 | |
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'; | |
} | |
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