Install WordPress multi-site
This article explains how to configure WordPress multi-site, enabling
you to build a network of websites in your WordPress installation.
Important: Rackspace Support does not support WordPress configuration.
This article provides steps as a best-effort solution, but your developers
should review them thoroughly before implementing them to prevent unexpected
downtime.
Prerequisites
- A WordPress installation
- Permalinks activated so that your URLs look like
http://example.com/my-page
instead ofhttp://example.com/?p=1654
- Deactivated plugins
- Backup of a WordPress installation
Modify wp-config.php
- Open the wp-config.php file on your server. Default location is
/var/www/html/. - Add the following line above the / That's all, stop editing! Happy
blogging. / comment:
define('WP_ALLOW_multi-site', true);
Network setup
-
Enter the administrator dashboard through http://YOUR_SITE/wp-config.php.
-
Navigate to Tools > Network Setup.
Note: Depending on your installation, you can choose between
using subdomains or subdirectories for your different sites. A subdomain
is similar to site1.example.com and site2.example.com, while a
subdirectory is similar to example.com/site1 and example.com/site2. -
In Network Title, enter a network name and the network administrator email.
-
Click Install.
Configuration and .htaccess files
-
Open the wp.config.php file for editing.
-
Place the following code after the line reading / That's all, stop editing!
Happy blogging. / comment:define('multi-site', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', 'website'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
-
Save your changes.
-
Open /var/www/html.htaccess for editing.
-
Replace all content in the file with the following code:
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]
Network Administrator menu
Performing the previous steps completes the multi-site installation. On the top left corner,
you should see a tab called My Sites, which includes a Network Admin menu with the following tabs:
- Dashboard: Add new users and sites to the network.
- Sites: Manage all the sites on your network.
- Add new: Add new sites and define the site
address (URL), title, language, and administrator email.
- Add new: Add new sites and define the site
- Users: Manage all the users of your network.
- Themes: Install, uninstall, and activate themes for the network.
- Plugins: Only the super admin can use the plugins administrator to install
new plugins. To allow the site admin to activate or deactivate them, the super admin should
select the Plugins checkbox on the Enable administration menus section of the Settings tab. - Settings: Manage the basic settings.
Conclusion
With WordPress multi-site, you can manage different sites under the same domain. If you choose to use
subdomains, consider using a wildcard certificate to cover all the sites.
Updated 12 months ago