Created
April 27, 2015 21:54
-
-
Save imagehat/faa9e27b01a26c2146c3 to your computer and use it in GitHub Desktop.
Worpress url override - wp-content/db.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter ( 'pre_option_home', 'env_url' ); | |
| add_filter ( 'pre_option_siteurl', 'env_url' ); | |
| function env_url() { | |
| return 'http://'.strtolower($_SERVER['HTTP_HOST']); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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