How to Install WordPress in a Subdirectory with HTACCESS Settings

install wordpress in subdirectory 404 error

So you have an existing WordPress installation and you would like to install a second install inside of a folder?  Have a 404 error when accessing the WordPress subdirectory? Not a problem.  You’ll find that you’ll get an error when install a second WordPress copy because the htaccess files with permalink rewrites conflict.  It’s a quite simple fix, just follow the instructions below!

Level of Difficulty: Easy

Step 1: Install WordPress in a Subdirectory as you would any WordPress install

If you need a quick link, here is the famous 5 minute install!

Step 2: Change HTACCESS File to Recognize Subdirectory Installation

OK, now that you went through the install process it’s time to make the site work by updating the htaccess file in your subdirectory. The htaccess file is located in your subdirectory. If you can’t find it, be sure you have “show hidden files” on in your ftp program or file browser.  Just add the following, replacing the “subdirectory-name” with the name or your subdirectory.  Now when you visit the folder, you shouldn’t see any 404 errors!

install wordpress in subdirectory without 404 error

# BEGIN WordPress
RewriteEngine On
RewriteBase /subdirectory-name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subdirectory-name/index.php [L]
# END WordPress

Any other cool tricks or ideas? Place a comment below!

Leave a Reply