How to host multiple WordPress websites on a single hosting package, underneath a subdirectory

Background

If you have WordPress Hosting, you might sometimes have the need to host more than one WordPress website on the same hosting package, the first being the primary website, and the other one(s) hosted in subdirectories below the primary website.

For example, you might have https://coolwebsite.com which is a WordPress website, but then also want to host https://coolwebsite.com/landingpage where /landingpage is actually an entire WordPress installation.

The key to getting this right is making sure that the subdirectory has the right redirection exclusions. If you don’t have the right exclusions, everything you access in the subdirectory might redirect you back to the primary website.

This article explains how to achieve this if you’re using Apache or LiteSpeed which both use .htaccess to manipulate redirects.

How to Host More Than One WordPress Website off a Subdirectory

On the second WordPress site, modify the .htaccess file in the root directory of that website to be:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /landingpage/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /landingpage/index.php/$1 [L,QSA]
</IfModule>

Note in the example above two change have been made to the stock .htaccess file included with WordPress.

Contact Vander Host because we experts at WordPress Hosting and offer highly competitive pricing and superior technical support. We even have a dedicated WordPress Hosting Knowledgebase Category.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top