{"id":1297,"date":"2018-01-12T11:14:56","date_gmt":"2018-01-12T11:14:56","guid":{"rendered":"http:\/\/www.vocso.com\/blog\/?p=1297"},"modified":"2024-09-05T16:15:37","modified_gmt":"2024-09-05T16:15:37","slug":"installing-wordpress-within-a-subdirectory","status":"publish","type":"post","link":"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/","title":{"rendered":"Installing WordPress within a Subdirectory &#8211; The 5 Step Process"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><p>Are you forward to install WordPress in a subdirectory? The process allows you to run several WordPress instances under one domain\/subdomain name. This tutorial will help you know the way to install WordPress in a subdirectory sans any effect on the parent domain name.<\/p>\n<p>Generally, WordPress website is preferred on its own domain name. However, there are times you would want to create additional websites too on the same domain name. Here, you need to do any of the following:<\/p>\n<ul>\n<li>Installing WordPress in a subdomain (newebsite.example.com)<\/li>\n<li>As a subdirectory (example.com\/newwebsite\/)<\/li>\n<\/ul>\n<p>When it comes to SEO, sub-directories get the added advantage from the <a href=\"https:\/\/www.vocso.com\/blog\/how-to-increase-boost-domain-authority\/\" target=\"_blank\" rel=\"noopener\">domain authority <\/a> of root domain which makes them rank higher. A WordPress multi-site network can be installed to create separate WordPress sites in a subdomain as well as subdirectory without any hassles.<\/p>\n<p>In case, you are interested in managing both sites separately, simply install different WordPress instances.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#heres-how-you-can-install-wordpress-in-a-subdirectory\" >Here\u2019s how you can install WordPress in a subdirectory:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#1-create-a-subdirectory-under-the-root-domain-name\" >#1. Create a Subdirectory under The Root Domain Name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#2-upload-wordpress-files\" >#2. Upload WordPress Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#3-create-new-database\" >#3. Create New Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#4-install-wordpress\" >#4. Install WordPress<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.vocso.com\/blog\/installing-wordpress-within-a-subdirectory\/#5-fixing-permalinks\" >#5. Fixing Permalinks<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"heres-how-you-can-install-wordpress-in-a-subdirectory\"><\/span>Here\u2019s how you can install WordPress in a subdirectory:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1-create-a-subdirectory-under-the-root-domain-name\"><\/span>#1. Create a Subdirectory under The Root Domain Name<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>Step 1 &#8211;&nbsp;<\/strong>Start by creating a subdirectory or folder under your root domain name. This is precisely where you will install WordPress files.<\/p>\n<p><strong>Step 2 &#8211;&nbsp;<\/strong>Now connect to WordPress hosting account. This is done by using File Manager or FTP client in cPanel.<\/p>\n<p><strong>Step 3 &#8211;&nbsp;<\/strong>After getting connected, visit your website\u2019s root folder (the \/public_html\/ folder). In case, WordPress is already installed in the root folder, you can see all WordPress files and folders there.<\/p>\n<p><strong>Step 4 &#8211;&nbsp;<\/strong>Right-click and select \u2018Create a new directory\u2019 from the menu.<\/p>\n<p>Be watchful when selecting the subdirectory name as it will form a part of URL of the new WordPress site and what users will type in their browsers to reach your site.<\/p>\n<p>For instance, if you wish to name the directory \u2018health-guides\u2019 then address for your WordPress website need to be:<br \/>\nhttp:\/\/example.com\/health-guides\/<\/p>\n<div class=\"sb-related-links-box\">\n<p>RELATED TOPIC:<\/p>\n<div class=\"sb-related-links-data\">\n<a href=\"https:\/\/www.vocso.com\/blog\/all-in-one-seo-wordpress-plugin\/\" target=\"_blank\" rel=\"noopener\">How To Setup All In One SEO WordPress Plugin Correctly \u2013 A Step By Step Guide<\/a><\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"2-upload-wordpress-files\"><\/span>#2. Upload WordPress Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The subdirectory you recently created is empty at present. So change this status via uploading WordPress files.<\/p>\n<p><strong>Step 1 &#8211;&nbsp;<\/strong>Start by visiting the website \u2018WordPress.org\u2019. Now click on the button \u2018download\u2019. The browser will download the zip file comprising of the latest WordPress software to your PC.<\/p>\n<p><strong>Step 2 &#8211;&nbsp;<\/strong>Select and extract the file once it is downloaded. If you are a Mac user, simply double click the file to extract it. For Windows, right click and select \u2018Extract All\u2019. Once you extract the zip file, a \u2018wordpress\u2019 folder will be visible. It contains all WordPress files.<\/p>\n<p><strong>Step 3 &#8211;&nbsp;<\/strong>It is time to upload these files to your new subdirectory. Now connect to your website by using an FTP client. Visit subdirectory that you created in the first step. Visit the \u2018WordPress Folder\u2019 that you extracted. This folder is present in your FTP client\u2019s local files panel.<\/p>\n<p><strong>Step 4 &#8211;&nbsp;<\/strong>Now select all files in the WordPress folder. Simply upload them to your new subdirectory.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3-create-new-database\"><\/span>#3. Create New Database<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>All of the content is stored in a database by WordPress. So when a new WordPress site is installed in a subdirectory, it is crucial to develop a new database to use.<\/p>\n<p><strong>Step 1 &#8211;&nbsp;<\/strong>Start by logging in to your WordPress hosting account\u2019s cPanel dashboard. Now click on \u2018MySQL Databases\u2019 which is visible under the section \u2018databases\u2019.<\/p>\n<p><strong>Step 2 &#8211;&nbsp;<\/strong>The next screen arrives and it is time for you to assign a name for your new database. Now click on the button \u2018Create Database\u2019 to continue.<\/p>\n<p><strong>Step 3 &#8211;&nbsp;<\/strong>The cPanel dashboard creates new MySQL database. Create a username for MySQL to be able to use this database. It is time to scroll down to the section \u2018MySQL Users\u2019 and assign a new username and password. Continue by clicking on the button \u2018Create User\u2019.<\/p>\n<p><strong>Step 4 &#8211;&nbsp;<\/strong>The next step is to allow privileges to the freshly created user on the database created earlier. Start scrolling down to the section \u2018Add user to database\u2019. Select MySQL username.<\/p>\n<p><strong>Step 5 &#8211;&nbsp;<\/strong>Now select the database, you created recently. To continue, click on the button \u2018Add\u2019. Full privileges will be granted to the MySQL user by Cpanel on your freshly created database.<\/p>\n<div class=\"sb-related-links-box\">\n<p>RELATED TOPIC:<\/p>\n<div class=\"sb-related-links-data\">\n<a href=\"https:\/\/www.vocso.com\/blog\/best-wordpress-website-maintenance-support-services\/\" target=\"_blank\" rel=\"noopener\">21 Best WordPress Website Maintenance and Support Services<\/a><\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"4-install-wordpress\"><\/span>#4. Install WordPress<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>It is time to <a href=\"https:\/\/wordpress.org\/support\/article\/how-to-install-wordpress\/\" rel=\"nofollow noopener\" target=\"_blank\">install WordPress<\/a>. All you need to do is visit the directory you created earlier in a web browser.<\/p>\n<p><strong>Step 1 &#8211;&nbsp;<\/strong>Type the following URL:<br \/>\nhttp:\/\/example.com\/your-subdirectory-name\/<br \/>\nThe step will display installation wizard WordPress. Select the language for WordPress website. Now click on the button \u2018continue\u2019.<\/p>\n<p><strong>Step 2 &#8211;&nbsp;<\/strong>Now you need to provide the following details:<\/p>\n<ol>\n<li>The database name of WordPress<\/li>\n<li>Username of database name<\/li>\n<li>Password<\/li>\n<li>Database host<\/li>\n<\/ol>\n<p><strong>Step 3 &#8211;&nbsp;<\/strong>Click on the button \u2018submit\u2019 after entering all of the above-listed database details.<br \/>\nThe action will prompt WordPress to connect to your database. A success message like the following will be displayed:<br \/>\n\u201cAlright! You\u2019ve made it to this part of the installation. WordPress can now communicate with your database. If you are ready, time now to\u2026<br \/>\n<em>Click<\/em> \u2018<strong>Run to install<\/strong>\u2019.\u201d<\/p>\n<p><strong>Step 4 &#8211;&nbsp;<\/strong>Follow the message instruction and click on the button \u2018Run the install\u2019 to continue.<br \/>\nThe next screen will appear where you will be asked to provide a title for your website. Here, you would also need to provide choose the following details:<\/p>\n<ul>\n<li>Admin username<\/li>\n<li>Password<\/li>\n<li>Email address<\/li>\n<\/ul>\n<p><strong>Step 5 &#8211;&nbsp;<\/strong> After entering your website details, click on \u2018Run install\u2019 button to continue.<br \/>\nNow WordPress will set up your website and display a success message like this:<br \/>\n<em>\u201cSuccess!<\/em><br \/>\n<em>WordPress has been installed. Thank you and enjoy!\u201d<\/em><\/p>\n<p><strong>Step 6 &#8211;&nbsp;<\/strong>Simply go ahead and login to your new WordPress website which has been installed in the subdirectory.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5-fixing-permalinks\"><\/span>#5. Fixing Permalinks<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Expect .htaccess files of your subdirectory to cause some conflict if there is a separate WordPress install within the root directory. The conflict will lead to \u2018404\u2019 errors on the website.<\/p>\n<p>The Solution \u2013 Most experienced freelance web developers and professionals would suggest you to edit the .htaccess file present within subdirectory WordPress install.<\/p>\n<p><strong>Step 1 &#8211;&nbsp;<\/strong>You need to replace the code in your .htaccess file with the code mentioned below:<\/p>\n<p>1. # BEGIN WordPress<br \/>\n2.&nbsp;&lt;IfModulemod_rewrite.c&gt;<br \/>\n3. RewriteEngine On<br \/>\n4. RewriteBase \/your-subdirectory\/<br \/>\n5. RewriteRule ^index\\.php$ &#8211; [L]<br \/>\n6. RewriteCond %{REQUEST_FILENAME} !-f<br \/>\n7. RewriteCond %{REQUEST_FILENAME} !-d<br \/>\n8. RewriteRule. \/your-subdirectory\/index.php [L]<br \/>\n9.&nbsp;&lt;\/IfModule&gt;<br \/>\n10. # END WordPress<\/p>\n<p><strong>Step 2 &#8211;&nbsp;<\/strong>&nbsp;Make sure you replace \/your-subdirectory\/ with the subdirectory name of yours.<\/p>\n<p>Hope the above tutorial helped you to install WordPress in a subdirectory. Good Luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you forward to install WordPress in a subdirectory? The process allows you to run several WordPress instances under one domain\/subdomain name. This tutorial will help you know the way to install WordPress in a subdirectory sans any effect on the parent domain name. Generally, WordPress website is preferred on its own domain name. However, <\/p>\n","protected":false},"author":45,"featured_media":3383,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,1399],"tags":[1385,1386,1381,1383,1380,242,1384,1379,1387,1382],"class_list":["post-1297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience","category-wordpress","tag-database-setup","tag-htaccess-configuration","tag-multi-site-wordpress","tag-seo-benefits","tag-subdirectory-installation","tag-web-development","tag-website-management","tag-wordpress-installation","tag-wordpress-tips","tag-wordpress-tutorial"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/posts\/1297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/comments?post=1297"}],"version-history":[{"count":0,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/posts\/1297\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/media\/3383"}],"wp:attachment":[{"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/media?parent=1297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/categories?post=1297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vocso.com\/blog\/wp-json\/wp\/v2\/tags?post=1297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}