• How To install Second WordPress in a Subdirectory for creating Multisite

    Installing WordPress in a Subdirectory is very easy like setting up a new WordPress based website on your Subdomain; What you need is just a bit understanding of the technology. People those want to run multiple WordPress instances without changing the root domain can go either for Subdomain or Subdirectory method. The core benefit in both the cases is you root domain will be the same.

    Installing the second WordPress in a subdirectory not only gives you a way to start a new niche website or blog under the same domain name but also helps in boosting your new WordPress website ranking. Here, today in this tutorial we will let you know, how to install a new WordPress instance in a Subdirectory without messing up with the parent or root domain.

    Now the question is, what is the difference between Subdomain and Subdirectory WordPress installation?

    The core difference between the installation of WordPress in Subdirectory and Subdomain is the URL structure.

    Generally, your main domain is in the form of www.example.com but to run multiple websites, let’s say WordPress based blog on your existing domain then you need to go for one of the below-given options:

    Subdomain:

    If you want to start a blog on your existing parent domain website as subdomain then the URL structure will be as blog.example.com.

    Subdirectory: 

    However, in a case of Subdirectory installation of WordPress blog; the structure will be like www.example.com/blog

     

    Now which is one better; Subdirectory or Subdomain from SEO point of view…

    The working, Look & feel and management of the second WordPress instance installed in a subfolder or on Subdomain is same. The thing which can affect a bit your new website is the SEO because the search engines will consider Subdomain website as totally different or new website and rank them according to that. While the website installed in the Subdirectory can get benefits of your the root domain authority and would rank higher in most of the cases as compared to the Subdomain.

    Also, the URL structure of the Subdirectory looks more familiar and if you create a link for it in your root domain website menu then the user can easily come and navigate to your new website form the main website.

    How to install WordPress in a subdirectory to root

    Step 1: Create a Subdirectory

    To create a Subfolder or directory, either you can log in to your web hosting CPanel to access File manager or just use FTP client like FileZilla to connect the WordPress hosting. Here in the tutorial, we are using the CPanel because we also need to create a separate database.

    Step 2: Login to Cpanel and open File Manager

    1. From the Cpanel select the File Manager option and you will see all your hosting files and folders. Now, you need to select the root folder of your main website, which usually resides under /public_html/ folder. If your main or parent website is on WordPress then you will see all your WordPress files and folders there.

    2. To create a new folder you will find an option called Folder. Click on that and create folder or subdirectory with a name that you want to give to your new website. For example, if you want to create example.com/blog then the folder name will be a blog. Here in this tutorial, we have created with a name of Wp; this means our new website subdirectory URL will be example.com/wp.

     

    WordPress in subdirectory

    If you are using some FTP client then just need to right click and select the option “Create directory“.

    FTP client to create subdirecoty in WordPress

     

    Step 3: Upload WordPress installation Files to Subdirectory

    1. Inside your newly created directory or folder which is empty right now; need to upload the WordPress files to install it on your new website.

    2. Go to WordPress.org  and click on the download button.

    download wordpress

    3. Open the newly created folder in Cpanel File Manager and find the option Upload. It will appear on the top of the menu bar. Click on it and upload the downloaded WordPress.zip folder.

    upload wp

    4. When you Click on upload a new window will open from where just click on the Choose File button and upload the WordPress zipped file.

    uploadwordpress

    After uploading, select the extract option either from the file manager menu bar or right click on the WordPress.zip folder and Extract it.

    Once it extracted you will see a WordPress folder. Open it and you will see all installation files and folder.

    Select them all… Now select the move option from the file menu or just right and select the Move.

    Move all wordpress files in cpanel

    Once you click on the MOVE option; a Move window will open with a path /public_html/Wp/WordPress delete the WordPress text from the path so that we can move all files and folder to our created subdirectory. In our case it is Wp and in your, it will show whatever name you have given to your Subdirectory.

    Move all WP files in cpanel

    Step 4. Create Fresh Database

    1. From the CPanel of your hosting, click on the MySQL databases.

    databases

    2. From the Database; under the Create New Database box type some name you want to give to your new database that going to be used for newly created WordPress instance present in the subdirectory. After typing some name click on Create Database button.

    Create new database

    3. Now scroll down and from MySQL users create a new user by giving Username and password. For adding new user click on Create user button.

    add new MYSQL user

    4.  When you scroll down further you will see a section Add USer to Database. Now click on User drop box and select your newly created MySQL user and from Database select your created database and click on Add button.

    Add use to database

    5. As soon as you click on Add button you will get a privilege screen from where select  All privileges checkbox and then click on Make Changes button.

    Manage user previlege

    In this way, you will assign the user to your database with all permissions.

    Step 5. Install WordPress in Subdirectory

    If you have done everything as mentioned above then just the task which left is the installation of the WordPress. Just open a new tab in browser and type the URL of your new website, i.e http://example.com/your-subdirectory-name/

    As you enter the URL of your new website it will bring a WordPress installation wizard screen.

    From the first screen of the WordPress installation select the language.

    select wordpress language

    After selecting the language, in the second screen, you need to enter the database and MySQL user information you have created above in this article to connect the WordPress for storing your content. Just enter the Database name, Username, and Password; leave the rest of as it is…

    Click on Submit button.

    setup login information WP

    After communicating with the database successfully the WordPress will give the message as mentioned in the below screenshot.

    Click Run the Install

    Run the WP install

    You will get the Welcome screen of the WordPress. Enter the information needed for your website such login Site title, username, password, and Your email ID.

    Wordpress welcome screen

     


    Finally, your new subdirectory based WordPress website is ready to use, go and log in.

     

    Fix Permalinks Problem form WordPress subdirectory .htaccess file.

    In most of the cases, your subdirectory website and permalinks of WordPress works without any 404 error.

    But in case,  you are getting WordPress subdirectory 404 error then you need to edit the .htaccess file present in your subdirectory.

    Go to a subdirectory, select the .htaccess file and edit it.

    Copy the below given the code and replace the text ” your Subdirectory name” with your subdirectory… For example, if your website URL is example.com/blog then the blog is your subdirectory name.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /your subdirecorty name/ RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /your subdirecorty name/index.php [L] 
    </IfModule> # ENDWordPress
    
    

    After editing save the .htaccess file.

    If you have any confusion or getting problem while performing this tutorial– how to install WordPress in a subdirectory please let us know… The comment box is all yours!!

     

    2 Comments

    1. koteshwar April 20, 2018
      • H2S Media Team April 20, 2018

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Real Time Web Analytics