Skip to content

Instantly share code, notes, and snippets.

@imagehat
Created April 27, 2015 21:54
Show Gist options
  • Select an option

  • Save imagehat/faa9e27b01a26c2146c3 to your computer and use it in GitHub Desktop.

Select an option

Save imagehat/faa9e27b01a26c2146c3 to your computer and use it in GitHub Desktop.
Worpress url override - wp-content/db.php
<?php
add_filter ( 'pre_option_home', 'env_url' );
add_filter ( 'pre_option_siteurl', 'env_url' );
function env_url() {
return 'http://'.strtolower($_SERVER['HTTP_HOST']);
}
@imagehat
Copy link
Author

If the file doesn't exisit create it at wp-content/db.php. See this explanation - "Using a Drop-In"

https://codex.wordpress.org/Running_a_Development_Copy_of_WordPress

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