• Hello,

    I am running a WordPress Network running on WordPress 4.1 with the WordPress MU Domain Mapping plugin. I have currently asked our developers to edit their hosts file so they can connect to the development environment. The team is becoming frustrated with toggling the hosts file on (for development) and off (for production).

    I’m proposing the following idea to make it easier for the team to jump between development and production:

    • Add an additional domain on the /wp-admin/tools.php?page=domainmapping page for the development environment
    • In the wp-config.php, define a constant stating which environment we’re in
    • If we’re in development, set the development hostname as primary

    Will this work?

    Is there an easier way to do this?

    Thank you,
    Ryan

    https://www.ads-software.com/plugins/wordpress-mu-domain-mapping/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    Why not use development domains in your development environment instead of the real domains? When you are using your hosts file the host does not need to be a legitimate domain.

    ex. actual domain is exampledomain.com, dev domain is exampledomain.loc.

    Thread Starter Ryan Marks

    (@rmarks)

    Hi Ron,

    I had intended to use a .lot or .dev domain. Sorry for not making that clear. What I had concerns about was being redirected from the development domain to the primary hostname for that Blog. Do you have a suggestion for how to overcome this issue?

    Thank you,
    Ryan

    Plugin Author Ron Rennick

    (@wpmuguru)

    Do you have a suggestion for how to overcome this issue?

    Use .loc for that as well.

    Thread Starter Ryan Marks

    (@rmarks)

    My goal is to use production data from the database in the development environment. I know this isn’t a standard way of doing local development, but this is the scenario I’m in.

    If I’m going to change the hostname of the network and each blog from .com to .loc, these are the places I think I will need to update:

    • wp_#_options.option_value
    • wp_#_postmeta.meta_value
    • wp_blogs.domain
    • wp_domain_mapping
    • wp_site.domain
    • wp_sitemeta.meta_value

    I also plan to edit wp-config.php to have DOMAIN_CURRENT_SITE and NETWORK_ADMIN_URL use mynetworkdomain.loc.

    Am I missing any other places to change?

    Thank you,
    Ryan

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Local Development URLs’ is closed to new replies.