Search code examples
wordpress.htaccessmultisite

Enable Wordpress Multi site (Network enabled)


I'm trying to activate multi-site in wordpress version 4.5.3 but keep getting the error message: Warning: An existing WordPress network was detected. Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.

I've deleted the tables and columns added by multi-site using the below:

drop table wp_blogs;
drop table wp_blog_versions;
drop table wp_registration_log;
drop table wp_site;
drop table wp_sitemeta;
drop table wp_signups;
alter table wp_users drop column spam;
alter table wp_users drop column deleted;

I've removed the following lines from /var/app/current/wp-config.php:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'site.tld');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

I've restored the original .htaccess file (from a back up and from re-generating using Settings -> Permalinks) so it looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

When I navigate to the Network Setup I'm greeted with the Create a Network of WordPress Sites page where I select Sub-domains and click Install.

There is no error on the following set up page, however if I refresh or navigate back to this page in any way I see the error at the top, regardless of whether or not I have applied the changes requested.

What am I missing here?


Solution

  • I moved the following lines from wp-config.php to the bottom of the file and then it started working

    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
            define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    

    If someone can let me know why this fixed it I will be very grateful, because it makes no sense why this would fix anything.