Wordpress, I hate it but I use it.
There are two things I do with every new Wordpress install, and they both exist in the wp-config.php file.
What you're going to achieve via this is per host settings for different environments (dev, test, staging, live...) and never have Wordpress force the hostname stored in the wp_config table. First, remove the DB settings lines and put them into a new file wp-config-localhost.php. These will be used later. Now add this set of lines into your wp-config below the WP_DEBUG line: // Checking to see if host-specific config exists$host_config_file = (ABSPATH . 'wp-config-' . preg_replace("/[^a-z0-9\-\.]+/","", $_SERVER['HTTP_HOST']) . '.php');
if (file_exists($host_config_file))
{
require_once($host_config_file);
} This will search for a wp-config.php file corresponding to the hostname you request the Wordpress site through, i.e. http://www.mywordpresssite.com will transfer to wp-config-www.mywordpresssite.com.php. This allows you to set DB and other settings per host. Note: you cannot redefine constants, so you may want to pull anything you want to change into these hostname specific config files. And directly under what you've just put in, put these two lines: define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); This will tell Wordpress to use the hostname of your site as the Wordpress home and site base url. This stops you installing it on a machine that had the Wordpress site accessed through http://localhost/ no longer try and throw the other person who is working on the site to http://localhost/, when they may have the site setup to be viewable through http://wordpress.mydomain.com/ etc. I hope this helps someone, somewhere, out there, over the rainbow....