WordPress SITE_URL in wp-config.php is not overriding database setting

In order to make my wordpress site easier to deploy I have added the following code to wp-config.php:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

It is my understanding that this should override any values stored in the database, but when I view source I see that wherever I have:

Read More
<?php bloginfo('template_directory'); ?>

…it is printing out the domain from the database value, rather than the one in wp-config.

Related posts

Leave a Reply

1 comment