Hello,
Please, follow the next steps to enable WordPress Multisite on your current WordPress installation:
- First of all, make a backup of the files involved in this process, just in case (htaccess.conf may not exist):
NOTE: Please, substitute /installdir
with the path where you have installed your stack. If you have launched it on a Cloud Provider, please substitute /installdir
with /opt/bitnami
.
cp /installdir/apps/wordpress/htdocs/wp-config.php /installdir/apps/wordpress/htdocs/wp-config.php.backup
cp /installdir/apps/wordpress/conf/htaccess.conf /installdir/apps/wordpress/conf/htaccess.conf.backup
- Now, edit
/installdir/apps/wordpress/htdocs/wp-config.php
and add the following piece of code at the top of the file, just below the <?php
header:
/** This will enable Wordpress' multisite feature */
define('WP_ALLOW_MULTISITE', true);
The top of the file will then look something like this:
<?php
/** This will enable Wordpress' multisite feature */
define('WP_ALLOW_MULTISITE', true);
/**
* The base configurations of the WordPress.
*
Again, make sure you leave the <?php
at the top.
- Now go to the Wordpress Dashboard, which is located at
http://your_server_address/wordpress/wp-admin
. Inside the Tools menu there is a new option, "Network". Click it.
- Now Wordpress will ask you about the details of your blog network. Fill in your information and click Install.
- At this point, Wordpress will show you a screen with instructions. Notice the two big blocks of code:
We will need them in a minute.
- Edit
/installdir/apps/wordpress/htdocs/wp-config.php
, locate the line /* That’s all, stop editing! Happy blogging. */
and paste the first big block of code above it. The result should be similar to this, except for your server address which will likely be different:
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', '127.0.0.1' );
define( 'PATH_CURRENT_SITE', '/wordpress/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
/* That’s all, stop editing! Happy blogging. */
- Edit
/installdir/apps/wordpress/conf/htaccess.conf
(create it if it doesn't exist) add at the begining of the file the second big block of code surrounded with <Directory "installdir/apps/wordpress/htdocs"> COPY HERE THE SECOND BLOCK OF CODE </Directory>
. Again, the result should be similar to this:
<Directory "installdir/apps/wordpress/htdocs">
RewriteEngine On
RewriteBase /wordpress/
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).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</Directory>
- Finally, edit
/installdir/apps/wordpress/conf/httpd-app.conf
. This file is the main application configuration file. Add here (if it wasn't) the htaccess.conf file, just writing the following line at the end of the file.
Include "/installdir/apps/wordpress/conf/htaccess.conf"
- Restart the Apache server.
sudo /opt/bitnami/ctlscript.sh restart apache
- Now you just have to log in again to the WordPress Dashboard (
http://your_server_address/wordpress/wp-admin
) and you will see a new option called "My sites" in the upper right corner:
Inside you will be able to create new sites.
Help! I followed the instructions and now Wordpress does not work! How do I restore the backup files?
- Just copy the backup files over the modified ones.
cp /installdir/apps/wordpress/htdocs/wp-config.php.backup /installdir/apps/wordpress/htdocs/wp-config.php
cp /installdir/apps/wordpress/conf/htaccess.conf /installdir/apps/wordpress/conf/htaccess.conf
- This will disable all multisite-related functionality.
Hope it helps,
Jose