I have googled and researched this issue as much as I could, but for some reason it is not as simple as described to make wordpress domain agnostic.
I want to make my website as portable as possible. Whats with the absolute urls? why are they so important? Is it really that hard to make a domain agnostic cms?
This is not working
$url = "http://".$_SERVER["HTTP_HOST"];
define('WP_HOME',$url);
define('WP_SITEURL',$url);
neither is this
define('WP_HOME', "http://{$_SERVER['SERVER_NAME']}/");
define('WP_SITEURL', "http://{$_SERVER['SERVER_NAME']}/");
nor this
$base_path = substr(ABSPATH, strlen($_SERVER['DOCUMENT_ROOT']));
define('WP_SITEURL', "http://${_SERVER['HTTP_HOST']}${base_path}");
define('WP_HOME', "http://${_SERVER['HTTP_HOST']}${base_path}");
Can anyone tell me how to make wordpress 4 domain agnostic?
thanks