Applicable to:
- Plesk for Linux
Question
How to set up WordPress Multisite in Plesk using sub-directories?
Answer
-
Go to Domain > example.com > Install WordPress;
Note: This step can be skipped if WordPress is already present on the domain.
-
Make sure Multisite feature was enabled after WordPress installation in Domains > example.com > File Manager > wp-config.php:
Before:
CONFIG_TEXT: /* That's all, stop editing! Happy blogging. */
After:
CONFIG_TEXT: define('WP_ALLOW_MULTISITE', true);
/* That's all, stop editing! Happy blogging. */This line enables multisite network feature.
-
Log into WordPress through Domains > example.com > Log in;
-
In WordPress Administrator Dashboard open Tools > Network setup;
-
Set Addresses of Sites in your Network to Sub-directories and click Install;
-
Copy the suggested configuration and add it in Domains > example.com > File Manager for wp-config.php and .htaccess files.
This is an example for wp-config.php:Before:CONFIG_TEXT: /* That's all, stop editing! Happy blogging. */
After:
CONFIG_TEXT: define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'example.org');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
/* That's all, stop editing! Happy blogging. */This is an example for .htaccess file:Before:CONFIG_TEXT: # BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressAfter:
CONFIG_TEXT: # BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
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]
</IfModule>
# END WordPress -
Set up additional directives to enable Multisite redirects:
Note: nginx serves dynamic content when Proxy mode is present and set to disabled state in Domains > example.com > Apache & nginx Settings:
In case dynamic content is served by nginx- Log into Plesk;
-
Go to Domains > example.com > Apache & nginx Settings;
-
Add the following to the Additional nginx directives:
CONFIG_TEXT: rewrite ^/([_0-9a-zA-Z-]+)/wp-admin$ /$1/wp-admin/index.php;
rewrite ^/([_0-9a-zA-Z-]+)/wp-admin/$ /$1/wp-admin/index.php;
rewrite ^/([_0-9a-zA-Z-]+)/((wp-(?:content|includes|admin)).*)$ /$2 break;
if ($request_uri !~ "^/(wp-(?:content|includes|admin)).*") {
rewrite ^/([_0-9a-zA-Z-]+)/(.*\.php)$ /$2 break;
}
set $test "";
if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test "${test}C";
}
if ($test = PC) {
rewrite ^/.*$ /index.php;
}
In case dynamic content is served by Apache Web Server- Log into Plesk;
- Go to Domains > example.com > Apache & nginx Settings;
-
Disable Static files processing (if present) and Apply the settings.
-
Re-login to the WordPress instance as an administrator in Domains > example.com > Log in next to WordPress instance
- Go to My Sites > Network Admin > Sites:
- Create additional sites in the WordPress network by clicking Add New:
Comments
12 comments
How do you set up Wordpress Multisite using TLDs? Is that possible with Plesk re domain mapping and I don't want to use any plugins.
Hi mark,
Could you please explain? Or show some draft example?
Hi Francisco,
I was hoping to set up Wordpress Multisite using TLDs instead of sub-domains so that I can create some one page websites, ideally without using a plugin. But I'd settle for using Sub-domains if that is doable? My hosting company doesn't allow you to create wildcard sub-domains so I'm a bit snookered right now. Any help appreciated.
Thanks
Mark
Hi mark
The TLD is described in this article (sub-directories are used).
I've also prepared a list of useful links for you:
https://www.plesk.com/blog/guides/change-wordpress-multisite-structure/
Related discussions may be found at our forum.
I have followed all the steps in order to make a multisite. The installation works fine and the multisite options are all presented to me. In the DNS i've added a wildcard symbol. That works as well. However when i try to access the dashboard after creating a brand new site on the sub-domain it gives me an error:
---------------------
Not Found
The requested URL /wp-admin/ was not found on this server.
---------------------
The front-end loads the web servers Default Page.
I've tried Both NginX and apache way. Same outcome.
I dont understand what im doing wrong. Can you help me?
Hello Daniel Jitbahadoer
Such behavior is to be investigated.
Please, could you submit a request for assistance? Depending on where the license was purchased, the request is to be created directly to us or to one of our partners.
Can I use this guide if I want to fully use Nginx instead of apache to serve WordPress?
Hello Sharul Hafiz
I would suggest trying this article: https://support.plesk.com/hc/en-us/articles/213924385
It's focused on your goal.
After following this guide and at the point where I add a new site, I get:
The link you followed has expired.
This has also been documented by another WordPress user here:
https://wordpress.org/support/topic/default-multisite-install-the-link-you-followed-has-expired
The standard advice of upping maximum execution time and upload and post maximum sizes littered all over the internet doesn't work.
I followed all the steps to convert single to multisites subdirectory option. However, once I re-login to wordpress a message pops up saying database need to repair. I follow the steps again to repair it, but still some database problems could not be repaired. Below are the message list of table doesn't exist.
KHOuJ_1_posts: Table 'wp_mmf.KHOuJ_1_posts' doesn't exist
KHOuJ_1_comments: Table 'wp_mmf.KHOuJ_1_comments' doesn't exist
KHOuJ_1_links: Table 'wp_mmf.KHOuJ_1_links' doesn't exist
KHOuJ_1_options: Table 'wp_mmf.KHOuJ_1_options' doesn't exist
KHOuJ_1_postmeta: Table 'wp_mmf.KHOuJ_1_postmeta' doesn't exist
KHOuJ_1_terms: Table 'wp_mmf.KHOuJ_1_terms' doesn't exist
KHOuJ_1_term_taxonomy: Table 'wp_mmf.KHOuJ_1_term_taxonomy' doesn't exist
KHOuJ_1_term_relationships: Table 'wp_mmf.KHOuJ_1_term_relationships' doesn't exist
KHOuJ_1_termmeta: Table 'wp_mmf.KHOuJ_1_termmeta' doesn't exist
KHOuJ_1_commentmeta: Table 'wp_mmf.KHOuJ_1_commentmeta' doesn't exist
May I know how can I fix this? Is there any steps I missed out?
Hello, i try to apply the method to have multisite, but in wordpress there is an error : Message d’erreur : cURL error 6: Could not resolve host: forum.audiovisuel74.com. what can i do ? Thanks !
I am getting the same issue as Daniel Jitbahadoer when using Multisite as Subdomains, which is mandatory for using Custom Domain names and not the sub-directory. Was there any help with this issue?
https://support.plesk.com/hc/en-us/articles/115002961393/comments/360001191820
Please sign in to leave a comment.