LiquidBook Development

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
1655-scary-mansion-on-a-hill-Grimdark-painti-stableDiffusion3SD3_sd3Medium-2128531760
scary mansion on a hill, Grimdark painting art style, dark and brooding composition, dramatic lighting, captures the ...
basset-hound-detective
A basset hound detective wearing a classic Sherlock Holmes-style outfit, complete with a deerstalker hat and a tiny, ...
DALL·E 2024-06-14 18.04.29 - A basset hound detective wearing a Victorian-era detective outfit, complete with a deerstalker hat and a tiny, tailored trench coat. The basset hound
A basset hound detective wearing a Victorian-era detective outfit outfit, complete with a deerstalker hat and a tiny,...
scary_mansion_on_a_hill
scary mansion on a hill, Grimdark painting art style, dark and brooding composition, dramatic lighting, captures the ...

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.