Created
May 19, 2022 07:56
-
-
Save DKudleichuk/35d49889887c6794197f677c7b8662b8 to your computer and use it in GitHub Desktop.
Dynamic WP_HOME and WP_SITEURL
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 | |
$protocol = (!empty( $_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
$domainName = $_SERVER['HTTP_HOST'] . '/'; | |
$home = $protocol . $domainName; | |
define( 'WP_HOME', $home ); | |
define( 'WP_SITEURL', $home ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment