[wp-hackers] Why WP_SITEURL and not $_SERVER['HTTP_HOST']?

Mike Schinkel mikeschinkel at newclarity.net
Tue Mar 30 10:37:21 UTC 2010

On Mar 30, 2010, at 6:27 AM, Hal Burgiss wrote:
> On Tue, Mar 30, 2010 at 04:03:41AM -0400, Mike Schinkel wrote:
>> P.S. Hmm.  If we need a constant, is there a reason why WP_SITEURL is not
>> just set in wp-config.php based on the value of $_SERVER['HTTP_HOST']?
> See http://codex.wordpress.org/Editing_wp-config.php, which mentions just
> this. I find it very useful for moving projects around from development
> environments to production, and never had it cause a problem.

Thanks Hal.  I've been doing exactly that for about 2 years now and I'm finally tired of it.  Not that the part you mention is hard, it's the other embedded paths in the database and the items that are domain related that get stored in the database (i.e. Google Maps API keys.)   I want to create a plugin that will automate this process as much as possible so I can not longer have to worry about setting things "just right" and no longer have to worry that I forgot to make that one critical change.  Better yet, I'd like to enable plugin and theme developers to make handle this process for their plugins and themes for me.

See http://www.wptavern.com/forum/plugins-hacks/1445-domain-switcher-plugin-functionality.html for more details.


More information about the wp-hackers mailing list