Codex tools: Log in
Just a note to say that i revised my post because there was a small bug in it for Windows users which is fixed in the latest version
(replaced '/..' with DIRECTORY_SEPERATOR.'..')BenXO 18:46, 15 May 2006 (GMT)
Just a note on this bit: "there's a simple hack for functions.php that can doesn't require you to update your database"
...talks about functions.php but the article is mostly focused on wp-config.php
Also "can doesn't" ?
function WP_LOCATION assumes $_SERVER['HTTPS'] returns null if http
At least for IIS, the value is "off" causing redirection to https.
This line should be replaced: $retval = 'http' . ($_SERVER['HTTPS'] ? 's' : null) . '://' . $_SERVER['HTTP_HOST'] . $wp_path ;
This line is correct: $retval = 'http' . ($_SERVER['HTTPS'] == "on" ? 's' : null) . '://' . $_SERVER['HTTP_HOST'] . $wp_path ;
Wouldn't this be easier in wp-config.php?
Add:
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] );
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content' );'
to the top of your wp-config file.