Skip to content

Instantly share code, notes, and snippets.

@AJ-Acevedo
Last active December 24, 2015 01:19
Show Gist options
  • Save AJ-Acevedo/6723009 to your computer and use it in GitHub Desktop.
Save AJ-Acevedo/6723009 to your computer and use it in GitHub Desktop.
Simple Solution to run a Development WordPress installation with the same database and codebase as the production server.
// Substitute URL for local/dev deploys
if ($option == "siteurl" || $option == "home") {
if ( strcmp($_SERVER['HTTP_HOST'], 'http://localhost') != 0)
return "http://$_SERVER[HTTP_HOST]";
}
@AJ-Acevedo
Copy link
Author

• Insert the above code into wp-includes/option.php between line 37 and 39.

• Change http://localhost to your development URL

• Change return "http://$_SERVER[HTTP_HOST]"; to return "http://$_SERVER[HTTP_HOST]";
to use SSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment