Installing a Network on Your Site - dummies

Installing a Network on Your Site

By Lisa Sabin-Wilson

The Network Details heading on the Create a Network of WordPress Sites page has options filled in automatically. The server address, for example, is pulled from your installation and is not editable. The Network Title and Administrator E-Mail Address are pulled from your installation database, too, because your initial WordPress site is the main site in the network.

  1. Click the Install button and WordPress creates new network tables in the database.


    The page refreshes, and the Enabling the Network page appears.

    From the Enabling the Network page, follow these steps to install the multisite feature after you install the network. Note: These steps require that you edit web server files, so be sure to have your text editor program handy.

  2. Add the network-related configuration lines to the wp-config.php.

    On the Create a Network of WordPress Sites page, WordPress gives you up to seven lines of configuration rules that need to be added to the wp-config.php file. The first line includes the line you added earlier in this chapter: define(‘multisite’, true );.

    You can skip that line, copy the rest of the lines, and then paste them beneath the define(‘multisite’, true); line in your wp-config.php file. The lines of code you add look like this:

    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/ ';
    define( 'DOMAIN_CURRENT_SITE', 'localhost' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    These lines of code provide configuration settings regarding subdomains, the base URL of your website, and your website’s current path. Additionally, it assigns a unique ID of 1 to your website and blog for the main installation site of your multisite network.

    The lines of code on the Create a Network of WordPress Sites page are unique to your installation of WordPress and specific to your site setup, so make sure that you copy the lines of code from your installation.

  3. Add the rewrite rules to the .htaccess file on your web server.

    WordPress gives you up to 13 lines of code that you need to add to the .htaccess file on your web server in the WordPress installation directory. The lines look something like 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]
  4. Copy the lines of code from the Enabling the Network page, open the .htaccess file, and paste the lines of code there.

    Completely replace the rules that already exist in that file.

  5. Save the .htaccess file and upload it to your web server.

  6. Click the login link at the bottom of the Enabling the Network page.

    You’re asked to log in to WordPress again because you have changed some of the browser cookie-handling rules in the wp-config.php and .htaccess files.

Completion of the installation steps activates a Network Admin menu item in the upper-right menu of links on your WordPress Dashboard. The Network Admin Dashboard is where you, as the site owner, administer and manage your multisite WordPress network.