You can upload the downloaded WordPress files to the server via FTP and drag & drop.<\/figcaption><\/figure>4. Create a new database<\/h3> At this point, some people get stuck setting up WordPress on a new subdomain, but it’s really easy if you follow these instructions.<\/p>
You need to create a database for your WordPress installation, otherwise you won’t be able to use the dynamic features you want to achieve with WordPress.<\/p>
Go to the cPanel of your hosting package, click on the MySQL Databases section and then on the CREATE DATABASE option.<\/p>
You can give your new database a name (a name that resembles your subdirectory is never a bad idea) and then have the option to create new users with new permissions.<\/p>
Create a user account and password for yourself and this user for your new database, and you’re ready to go!<\/p>
5. Edit the wp-config.php file<\/h3> Go back into your FTP client or your file manager in cPanel for a moment so you can edit your WP-config.php file.<\/p>
This file will be filled with various lines of code, but you’re mainly looking for a handful of custom settings.<\/p>
Search for:<\/p>
define('DB_NAME', 'database_name_here');\ndefine('DB_USER', 'username_here');\ndefine('DB_PASSWORD', 'password_here');<\/code><\/pre>In the file (near the first lines), replace the placeholder text for your new database name, your new database user name, and your new database user password.<\/p>
Save the file, make sure it’s uploaded to the same directory (replacing the existing file), and you’re ready to start the actual installation.<\/p>
6. Install WordPress<\/h3> The easiest way to go through the WordPress installation process in your subdirectory is to navigate to the new subdirectory address after reconfiguring your wp-config.php files.<\/p>
https://www.yourdomain.com\/yoursubfolder\/<\/code><\/pre>Once you access this address in your browser bar, you will be redirected directly to the WordPress installation wizard.<\/p>
Choose the language you want to use for the installation (English is selected by default), go through the on-screen instructions and after about 15 or 20 seconds you will have the option to start the installer yourself.<\/p>
This process usually takes a few more seconds to a few minutes, and after 5 to 10 minutes your new WordPress installation is up and running in a specific subdirectory.<\/p>
Now you’re ready to go!<\/p>
<\/span>Access via the main domain<\/span><\/h2>There are cases when you don’t want your visitors to see that WordPress is installed in a subdirectory.<\/p>
Maybe because there is an old installation in your root directory.<\/p>
To do this, you just need to change the path settings in your new WordPress site. From<\/p>
https://www.yourdomain.com\/yoursubfolder\/<\/code><\/pre>to<\/p>
https://www.yourdomain.com\/<\/code><\/pre>Additionally, you need to download both your .htaccess and your index.php and move them to your root directory.<\/p>
I’ll explain exactly how this works in a separate tutorial.<\/p>
<\/span>Which is better for SEO? A subdomain or a subdirectory?<\/span><\/h2>When it comes to search engine optimization (an important piece of the puzzle when it comes to online success these days, especially for small businesses in competitive niches), you need to make sure you’re doing everything you can to give yourself a boost.<\/p>
That’s why it’s so important to install your new WordPress blog in a subdirectory of your main domain, rather than creating a subdomain.<\/p>
Because all major search engines (first and foremost Google, of course) treat subdomains differently than subdirectories – and they even treat them differently than root domains!<\/p>
However, subdirectories are not treated so strangely.<\/p>
Instead, subdirectories are treated the same as a main domain name. This means that all the search engine optimization measures you have taken for your main domain will also be applied to your new blog and vice versa.<\/p>
Search engine optimization is much better with a WordPress installation in a subdirectory than with a subdomain, that’s for sure.<\/p>","protected":false},"excerpt":{"rendered":"
In this tutorial, I will show you how to install WordPress in a subdirectory. This is useful for anyone who wants to keep their website separate from the main domain. Especially if you want to create websites with completely different topics, installing WordPress in a subdirectory is the way to go. Not only will I … Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1611,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"limit_modified_date":"","last_modified_date":"","inline_featured_image":false,"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"yoast_head":"\nHow to install WordPress in a Subdirectory - WPfellows<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n