Just Beyond The Bridge

Wordpress: Moving From Development or Staging to Live

Friday, April 17, 2009

Pigeon-holed in “Web-Design

It’s been a long annoyance of mine that Wordpress insists on writing paths directly into the database, so when switching from staging or production to live you have to alter these paths.

However, if you also find this an irritation, a quick way to solve it is to define a couple of constants in the wp-config.php file. You simply define the url and home addresses as below, and as long as you are running a server that supports the server variable HTTP_HOST (e.g. Apache) the switch should be automatic and override the settings in the control panel.


// WordPress address on settings page
define(’WP_SITEURL’, $_SERVER[‘HTTP_HOST’]);
// Blog address on settings page
define(’WP_HOME’, $_SERVER[‘HTTP_HOST’]);

Comments (0)

This is Just Beyond The Bridge

Something About Me

Called Andy, I am passionate about design, love to travel, and have a knack for all things digital. This is the full story…

September 2010
M T W T F S S
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

More Stuff

Back Catalogue

  1. Apr ‘10
  2. Jan ‘10
  3. Oct ‘09
  4. Sep ‘09
  5. Aug ‘09
  6. Jul ‘09
  7. Jun ‘09
  8. Apr ‘09
  9. Mar ‘09
  10. Feb ‘09
  11. Jan ‘09
  12. Dec ‘08
  13. Nov ‘08
  14. Oct ‘08
  15. Sep ‘08
  16. Aug ‘08
  17. Jul ‘08
  18. Jun ‘08
  19. May ‘08
  20. Apr ‘08
  21. Mar ‘08
  22. Feb ‘08
  23. Jan ‘08
  24. Dec ‘07
  25. Nov ‘07
  26. Oct ‘07
  27. Sep ‘07
  28. Aug ‘07
  29. Jul ‘07
  30. Jun ‘07
  31. May ‘07
  32. Apr ‘07
  33. Mar ‘07
  34. Feb ‘07
  35. Jan ‘07
  36. Dec ‘06
  37. Nov ‘06
  38. Oct ‘06
  39. Sep ‘06
  40. Aug ‘06
  41. Jul ‘06
  42. Jun ‘06
  43. May ‘06
  44. Apr ‘06
  45. Mar ‘06
  46. Feb ‘06
  47. Jan ‘06
  48. Dec ‘05
  49. Nov ‘05
  50. Oct ‘05
  51. Sep ‘05
  52. Aug ‘05
  53. Jul ‘05
  54. Jun ‘05
  55. May ‘05
  56. Apr ‘05
  57. All Archives

Search