How to Install WordPress in a Sub-Directory?

Install WordPress on a sub-directory, and you can run multiple WordPress instances within the same domain or on a subdomain.

We will show you how to install and run WordPress on the sub-directory.

Create a Sub-Directory Inside Your WordPress Installation 

  1. You can connect your existing WordPress installation using cPanel File Manager or FTP.

  2. Once it is connected, create a sub-directory.



3. Now, upload the WordPress zip into that sub-directory; then unzip and extract it. 

4. Add the WordPress database details in wp-config.php.

5. Install WordPress on the installation page.

6. Access the WordPress admin installed within the sub-directory page.  

7. If a separate WordPress is installed at the root directory, we will need to put the code shown below in the .htaccess file of your sub-directory. 

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

8. You will need to replace the /subdirectory with your sub-directory name.  

That’s it!
We have installed WordPress on a separate sub-directory.


Was this answer helpful?

« Back

chat