Linux Mastering Development Ubuntu

WP Multi-Site Install on Ubuntu 18.04 LAMP Keeps Re-Directing URL

After a few weeks of head banging… I am very near to completing a local development environment for my WP Multi-Site Installation. The final problem that I have (wishful thinking), is that the primary address of the WP LAMP installation keeps re-directing improperly. I don’t seem to be able to find the correct configuration of /etc/host and wp-config and apache2 virtualhost, nor WP Database Site URL to get my local development environment to load properly, so that I can actually start the real work of editing sites and content.

Saying that my production site is on the url "" and my local dev site is on the url "", the following is a detailed description of my current quagmire:

1.) Currently, dev site improperply redirects to resulting in an error, preventing site from loading. Is this an ubuntu thing?

2.) With regards to my WP Database Site Url, I used the advice found at the bottom of this page because of a previous redirection problem sending to the site to the wp-login page. In a nutshell, I changed all the urls in my dev site database from being "" to being "" using the correct variant of this SQL query:
enter image description here

However, this solution did not solve the url re-direction problem. (For clarity purposes, yes I can connect to the database correctly now.)

3.) From there I edit my wp-config file according to the advice found here to the following values:

define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', ''); 
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define( 'SUNRISE', 'on' );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIE_DOMAIN', '' );
define( 'COOKIEPATH', '' );
define( 'SITECOOKIEPATH', '' );
define( 'NOBLOGREDIRECT', '' );

4.) In accordance with advice found here, I edit my apache2 virtualhost file ("example.conf") to reflect the following:

<VirtualHost *:80>

    # If this is the default configuration file we can use: 'ServerName localhost' or also 'ServerAlias localhost'.


    ErrorLog ${APACHE_LOG_DIR}/
    CustomLog ${APACHE_LOG_DIR}/ combined

    DocumentRoot /var/www/html/
    <Directory /var/www/html/>
        Options None FollowSymLinks
        # Enable .htaccess Overrides:
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        Require all granted

    <Directory /var/www/html/>
        Options FollowSymLinks
        Order allow,deny
        Allow from all


5.) And finally, I went to my /etc/host file and made the following entry:   localhost 

Of course, I remember to restart apache and mysql servers to make sure the changes were updated. Yes, I also enabled "" on apache2 as well.

At this point I am just stuck. Any advice on how to the solve the redirection problem, highly appreciated…. What am I missing? hhmm….

Also, a final secondary question:

Assuming that one of you Ubuntu / WP superpeople can spot my error above. I also have to subsites on the installation as well, let’s call them "" and ""… How would I reacha and edit them on my local dev site? Should I just make entries in my host file? Or do I have to make separate virtualhost files, enable them, then point them at the primary directory of the multi-site ""

Thanks again,


Leave a Reply

Your email address will not be published. Required fields are marked *