Skip to content

Instantly share code, notes, and snippets.

@dalethedeveloper
Created January 9, 2014 15:57
Show Gist options
  • Save dalethedeveloper/8336483 to your computer and use it in GitHub Desktop.
Save dalethedeveloper/8336483 to your computer and use it in GitHub Desktop.
WordPress wp-config.php hack to force a WP site to respond to whatever domain you access it from, database wp_options be damned. Thanks Rackspace Cloud Sites!
// Anywhere in the wp-config.php before the last include
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment