Home > Help Center > Applications > WordPress > WordPress Multisite with Subdirectory URL

WordPress Multisite with Subdirectory URL

Much of the things we showed about WordPress Multisite with Subdomain URLs are also valid when we decide to use Subdirectory URLs.

As far as site management is concerned, there is practically no difference.

To convert a WordPress site into Multisite, we need to create a sub/domain and install the WP itself.

Unlike Multisite subdomains, you do not need to create subdomain for each network site - when you add a site, you choose a subdirectory name (the most likely a keyword close to the site's main theme).

Let's configure a subdomain wpmusubfolder.example.com to /public_html/wpmusubfolder:

wordpress multisite subdirectory

We install for a few seconds with a single click WordPress using the extremely convenient automatic scripts installer Softaculous:

wordpress multisite subdirectory

To enable the Network Setup menu item, you must first define multisite in the wp-config.php file.

Open up wp-config.php and add this line above the text:

/* That's all, stop editing! Happy blogging. */.

If you cannot find such text anywhere in the file, then add the line somewhere above the first line that begins with require or include or just below the row define('WP_DEBUG', false);:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

Now click Tools > Network Setup to open Create a Network of WordPress Sites screen.

wordpress multisite subdirectory

Under Addresses of Sites in your Network select Sub-directories radio button:

wordpress multisite subdirectory

Network Details are filled in automatically but you can change the network title and network admin email. Be careful with email address because the associated with it user will get super-admin privileges over the entire network.

Click Install button to enter Create a Network of WordPress Sites screen.

wordpress multisite subdirectory

Follow the instructions on the page:

  • Add the specified code to wp-config.php file just after where you added the multisite code earlier.
  • Add the specified code to .htaccess file and replace any existing WP code with this new one.

wp-config.php code:

define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', false);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'site-domain');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Important: replace site-domain with your domain.

.htaccess code:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
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]

Click log in link.

WordPress will log you out to finish network setup.

When you log in again you will notice a new icon My Sites in the upper left corner.

Hover the mouse over it and click Network Admin > Sites link:

wordpress multisite subdirectory

Add New Sites to the Network

Click Add New button.

Fill in the name of your virtual subdirectory, site title and admin email:

wordpress multisite subdirectory

Click Add Site button.

Repeat the above step to add as many sites you want.

To view sites configuration click Sites > All Sites

wordpress multisite subdirectory

We can edit the title and tagline for each site following these steps: Click Sites > All Sites

wordpress multisite subdirectory

Hover over URL and click Edit

wordpress multisite subdirectory

Click Settings tab:

wordpress multisite subdirectory

Edit the text in Blogname and Blogdescription fields:

wordpress multisite subdirectory

Scroll down the page and click Save Changes button.

Repeat above steps for each site.

Now let's test the sites from our network:

wordpress multisite subdirectory

wordpress multisite subdirectory

wordpress multisite subdirectory

Congratulations. All steps are done correctly.

In the next article we'll show you how you can import your existing WordPress site with Softaculous – you'll be amazed to see how easy it actually is.

#wordpress #multisite

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support