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 "example.org" and my local dev site is on the url "localhost.example.org", the following is a detailed description of my current quagmire:

1.) Currently, dev site improperply redirects to http://localhost.example.org/localhost.example.org resulting in an error, preventing site from loading.

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 "example.org" to being "localhost.example.org" 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', 'localhost.example.org'); 
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', 'localhost.example.org' );

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

<VirtualHost *:80>

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

    ServerAdmin info@example.org

    ErrorLog ${APACHE_LOG_DIR}/localhost.example.org.error.log
    CustomLog ${APACHE_LOG_DIR}/localhost.example.org.access.log combined

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

    <Directory /var/www/html/example.org/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all


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

Of course, I remember to restart apache and mysql servers to make sure the changes were updated. Yes, I also enabled "example.org" 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 WP superpeople can spot my error above. I also have to subsites on the installation as well, let's call them "webinar.example.org" and "myname.org"... 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 "example.org"

Thanks again,


  • Never found the cause of the problem, but a user (@pa4080) recommended that I try a migration plugin, which eventually solved this problem, but left other problems. :-( may be posting here again soon if I can't find answers... – yupthatguy Jul 1 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.