Created
April 30, 2018 15:16
-
-
Save ltitus210/7a2314c27aad864810a3988b05697627 to your computer and use it in GitHub Desktop.
Support http and https concurrently in wp-config
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
# Support http and https concurrently | |
function isSecure() { | |
return | |
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') | |
|| $_SERVER['SERVER_PORT'] == 443; | |
} | |
$web_site = $_SERVER['HTTP_HOST']; | |
$schema = isSecure() ? 'https://' : 'http://'; | |
$web_site_url = $schema . $web_site; | |
define('WP_HOME', $web_site_url); | |
define('WP_SITEURL', $web_site_url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment