For doing local development on a WordPress site (http://www.example.com), I was previously overriding the WP_SITEURL
and WP_HOME
values in wp-config.php
like so:
define('WP_SITEURL', 'http://local-example/');
define('WP_HOME', 'http://local-example/');
This would allow me to copy the database and site files to a local server, and make modifications as necessary, testing on the local install.
It was then necessary to convert the install to a WordPress Multisite so that users, authentication, plugins, etc. could be shared between the main site and a secondary site, hosted on a subdomain (http://second.example.com).
The method above to override the values in the wp_options
table no longer works, but I am unsure the proper way to set a value for the entries in wp_blogs
as well as the wp_2_options
table for the primary and subdomain.
Updating my HOSTS
file is somewhat of a workaround, but it not ideal (I am not able to compare to the live site, etc). Running a script to change the database values is another option I have tried, but is slightly more cumbersome, so my questions is whether or not there is an option in MultiSite to override these values in a settings file, such as wp-config.php
, and if so what it would look like.