Installing a second WordPress instance in a subfolder

I recently worked on a project where the client wanted to add a second WordPress instance (install) within a subfolder of the main site. The main WordPress site is a WordPress directory website. The new second site is a magazine with a different identity. Normally, you put your blog in a subfolder like mysite.com/blog, and you can easily create a different look for that section. This is a scenario where you need a different WordPress instance. With a second WordPress site, there are three domain options.

Three domain options for your second WordPress instance

  1. newsite.com  – new domain
  2. newsite.mainsite.com  – subdomain
  3. mainsite.com/newsite/  – subfolder

There are many pros and cons for each domain scenario. One of the big pros for using the subfolder is the increased SERFS value. I have listed some articles below if you want to read more about choosing a domain option, and the best practices and SEO considerations.

Second installation of WordPress and the permalink subfolder conflict

WordPress does not like this scenario. If your second subfolder installation is successful, you may likely run into an issue when WordPress writes its Permalink (within the subfolder). The issue apparently has to do with the subfolder installation and how it sees the site root path. WordPress will normally write a .htaccess file in the installation directory, and that folder is usually the website root folder. Here is the applied solution:

=====  Original WordPress .htaccess (within the subfolder)  ========

# BEGIN WordPress
<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 WordPress

The solution is in the .htaccess file within the subfolder

=====  change to new WordPress .htaccess (within the subfolder)   ========

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /newsite/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /newsite/index.php [L]
</IfModule>
# END WordPress

Further reading on installing in a subfolder and the .htaccess issue:

Further reading on domain options, and the best practices and SEO considerations:

If this is helpful or you have something you want to add, please leave a comment.

Social Sharing
cybercat
a cyborg cat, background futuristic city in the style of anime, night time scene, soft focus
superman-comfyui-1
a close up of a superman, moody iconic scene, pleading face, eye light on the face, soft focus backlight, golden hour...
the darknight
a close up of the dark night by frank miller, moody iconic scene, soft focus backlight, golden hour, Gotham city scap...
superman night time scene
a close up of a superman, moody iconic scene, pleading face, eye light on the face, soft focus backlight, golden hour...

This website stores cookie on your computer. These cookies are used to collect information about how you interact with our website and allow us to remember you. We use this information to improve and customize your browsing experience and for analytics and metrics about our visitors both on this website and other media. To find out more about the cookies we use, see our Privacy Policy.