Difference between revisions of "WordPress Any URL"

From KOP KB
Jump to: navigation, search
(Created page with "Placing the below code into a wp-config.php file will allow a WordPress site to load properly under any URL that calls it. <syntaxhighlight lang="php" enclose="div"> $metho...")
 
 
Line 3: Line 3:
 
<syntaxhighlight lang="php" enclose="div">
 
<syntaxhighlight lang="php" enclose="div">
 
$method = (empty($_SERVER['HTTPS'])) ? 'http://' : 'https://';
 
$method = (empty($_SERVER['HTTPS'])) ? 'http://' : 'https://';
define('WP_HOME', $method . $_SERVER['HTTP_HOST']);                                          
+
define('WP_HOME', $method . $_SERVER['HTTP_HOST']);
 
define('WP_SITEURL', $method . $_SERVER['HTTP_HOST']);
 
define('WP_SITEURL', $method . $_SERVER['HTTP_HOST']);
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 20:15, 5 April 2018

Placing the below code into a wp-config.php file will allow a WordPress site to load properly under any URL that calls it.

$method = (empty($_SERVER['HTTPS'])) ? 'http://' : 'https://';
define('WP_HOME', $method . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $method . $_SERVER['HTTP_HOST']);