Skip to content

Instantly share code, notes, and snippets.

@avioli
Created November 7, 2013 05:33
Show Gist options
  • Save avioli/7349520 to your computer and use it in GitHub Desktop.
Save avioli/7349520 to your computer and use it in GitHub Desktop.
<?php
# add to your wp-config.php, ANYWHERE before "require_once(ABSPATH . 'wp-settings.php');" line
# you can drop the :8080 if you serve it on the regular port
# change <your.old.domain.com> to your domain you wish to replace
define('WP_HOME', 'http://localhost:8080');
define('WP_SITEURL', 'http://localhost:8080');
function _fix_siteurl_in_html( $buf = '' ) {
$buf = str_replace( 'http://<your.old.domain.com>/', WP_SITEURL . '/', $buf );
return $buf;
}
ob_start('_fix_siteurl_in_html');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment