How to install a WordPress Multisite

This is meant as a very short form of the overly long Codex post.

  1. Start with a clean regular single-site installation in the server document root. Do not install WordPress in a subdirectory, this will break.
  2. Be an admin.
  3. Make sure your salts are complete in your wp-config.php.
  4. Give PHP at least 128MB memory limit. More is better, less might break your site. Make sure your PHP version is up to date: version 7 is good, 5.3 is too old, and 5.2 is hacked the moment you go online.
  5. Add the constant that enables multi-site:
    define( 'WP_ALLOW_MULTISITE', TRUE );
  6. Make sure that require_once(ABSPATH . 'wp-settings.php'); is always the last line in that file, put custom code above of it.
  7. Then go to Tools/Network Setup, use Sub-directories or Sub-domains if your are prepared for that (see Multisite on Windows with wildcard subdomains).
    // Set this to true for sub-domain installations.
    define( 'SUBDOMAIN_INSTALL',    false      );
    define( 'DOMAIN_CURRENT_SITE',  'mstest.wp');
    define( 'PATH_CURRENT_SITE',    '/'        );
    define( 'SITE_ID_CURRENT_SITE', 1          );
    define( 'BLOG_ID_CURRENT_SITE', 1          );
  8. … and .htaccess, replace the default WordPress rules with this:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
  9. Log in again, and you are done.