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.

  • Recep_Baltas

    The 404 guide link gives 404, ironically 🙂

    • João Guilherme

      hahahahaha, did the same thing, got so sad 🙁

    • Arijit Biswas

      Hahaha. :p

  • Arvind Bhardwaj

    It worked!

© 2014 LiquidBook. All Rights Reserved.   Privacy Policy | Site Map