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.

Published by

Felipe Lujan-Bear

I am both a left and right brain person. I have spent over 15 years as an online developer and designer. After attending the Academy of Art - San Francisco, I worked in online learning for a number of years at Pearson, plc as project manager for UK-based university websites. I have worked on projects for Hyperion - Oracle, Mercury Interactive - HP, Thinstall - VMware, eTrade, Wind River, and many others. My projects have included developing large websites, custom CMS, trade show presentation and collateral material, partner marketing, inbound marketing, video production, flash development, and WordPress site design and development. On the creative side, my skills run to a full range of design, animation, video, and photography. On the technical side my skills include a wide range of internet technology such as PHP, MySQL, JavaScript, Jquery, HTML, CSS, XML, and more. Because I have worked in the corporate world for many years, I understand the complex challenges involved in professional design and development.

Leave a Reply

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