Advertisement

Installing a Network on Your WordPress.com Site

After you have edited and configured your Apache code and enabled the Network feature for your WordPress site, you are finally ready to install the actual network. The Network Details heading on the Create a Network page has options filled in automatically. The server address, for example, is pulled from your installation and isn’t 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. Clicking the Install button causes WordPress to create new network tables in the database. The page refreshes and the Create a Network of WordPress Sites page appears.

image0.jpg

From the Create a Network of WordPress Sites page, follow these steps to install the multisite feature after you install the network.

These steps require that you edit web server files, so be sure to have your text editor program handy.

  1. Create a directory on your web server called blogs.dir.

    In your WordPress installation directory is a folder labeled /wp-content/. In that folder, create your new directory, which stores all the uploaded media (photos, videos, audio, and other media) within the network sites on your domain. The entire path should look similar to /public_html/wp-content/blogs.dir.

    Most FTP programs allow you to create a new directory (or a new folder) by right-clicking in the web server window and choosing Make New Directory.

  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 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. The lines of code you add look like this:

        define( ‘SUBDOMAIN_INSTALL’, true );
        $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]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    You must have the Apache mod_rewrite module installed on your web server to run the WordPress multisite feature. The rules you add to the .htaccess file on your web server are mod_rewrite rules. They need to be in place so that your web server tells WordPress how to handle things, such as permalinks for blog posts and pages, media, and other uploaded files. Without these rules in place, the WordPress multisite feature will not work correctly.

  4. Copy the lines of code from the Create a Network of WordPress Sites 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. Return to the Dashboard and click the Dashboard link at the top of the menu navigation.

    You may be 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 in your WordPress Dashboard. The Network Admin section is where you, as the site owner, administer and manage your multisite WordPress network.

blog comments powered by Disqus
Advertisement
Advertisement

Inside Dummies.com