Sometimes, you may need to operate multiple sites in a single domain. Perhaps, you want to link a blog section or e-commerce store to your main site. Well! a subdirectory can be your best bet. It helps you run multiple websites under the same domain name.
The process is quite straightforward, most reliable web hosting companies enable you to create subdirectories in a matter of minutes-the popular free web hosting company 000webhost.com has this feature as well.
In this post, we will talk a bit about the sub-directories and how we can install WordPress within it step by step. If you’re new to WordPress, you may want to know how to start WordPress; 000webhost.com presents a complete guide about installing the WordPress.
What are subdirectories?
Let’s understand it with an example. Let’s suppose if you need to save the photos of cars to your main image folder, you will set up a subdirectory like cars inside. The similar process implements for WordPress sites too.
Although you can use the same WordPress installation to run a WordPress site and a blog yet sometimes it is a good idea to use subdirectories, mainly when you are operating a big operation.
Scenarios when using Subdirectories makes Sense:
-If you are looking start an online store alongside your site, it is a good idea to set up an online store in a separate subdirectory to avoid confusion.
– if you are looking to create a multilingual website, choosing subdirectory can be your smart move
-If you are using multiple CMS (content management systems). For instance, your main site is on WordPress Platform, but for the online store, you want to use Magento. Subdirectories can be your best buddy in this scenario.
Difference Between Subdirectories & Subdomains
If your novice to website building you can get confused between two similar terms: subdomains and subdirectories. Here it is essential to understand that they are not the same thing even they work similarly.
Though you can you use subdomains for every condition that we mentioned above yet, subdirectories are always a better option.
We can say a subdirectory is the part of your URL that includes a particular subset of the content whereas subdomain is a division of your primary domain that is used to organize your main website into an individual site.
Subdirectories have some advantages from the SEO point of view as well. Search engines like Google, Bing, Yahoo, etc. consider subdomains as separate websites. It simply means you are not going to relish the benefits of search engine optimization that you’re doing for your primary domain.
On the contrary, since directories are the part of your original domain, your SEO efforts will not go waste.
Let’s move to the installation part.
How to Install WordPress in a Subdirectory
Installing WordPress in a subdirectory is like a piece of cake you don’t need to install any plugin. You just need to access the control panel of your site that is provided your web host. As you’re going to create a subdirectory into your current domain, you should not forget to create a back your entire website before starting the procedure.
Access control panel provided by your hosting provider. Next, click on the file manager option. You should locate your WP files under the public_HTML directory. Now, you have to develop a new subdirectory in this section. Add a new directory by creating a new folder.
Don’t give your folder the name which is already in use. As this name is going to be typed by your visitor, make sure you are choosing an appropriate name. Another thing that is important to mention that don’t leave a space between names. For instance, if you need to write ‘first directory’ it should be like first-directory.
Next, you have to install WordPress in this newly created folder. Visit the WordPress.org download page and hit the Download WordPress button available on the right side corner of your desktop.
Now place this downloaded zipped file into your newly created subdirectory folder. Unzip it in the folder that you can do by clicking the extract button. Now you should be able to see a WordPress folder.
Now there are two things that you have to do:
- Creating a new database for your subdirectory
- Installing the WordPress
How to create a new database for your subdirectory-
Again access the control panel of your site and click on the MySQL database option.
Here you have to set credentials( database name, username, password) for your new database and add the necessary privileges to the new user you created. Just go through the page and add all the required information. Save your filled information in each section.
Finally, it is time to go through WordPress installation. So let’s go through it.
Type the following URL into your browser.
In place of the new directory, you have to write the name of the subdirectory. By accessing this page, you will reach directly inside the installation wizard. Follow all the instructions step by step. Fill all the asked fields and information. Next, you will be asked to Install WordPress.
As you already have WP installed in your root directly, it may cause a 404 error, but don’t worry you can fix it easily. Just copy and paste the code given below in your .htacess file.
Congratulations! You have successfully installed WordPress into your subdirectory. You can give your new directory any name but make sure it is catchy. You can change this name whenever you want.
How to Use New Subdirectory
It is necessary to treat your subdirectory as brand new WordPress site. You can advertise and link it to your main website so that your users could know about your subdirectory. It will also help you to boost up the traffic to your site.
Add fresh content and valuable content on it. Give your subdirectory an elegant design and interface.
Some useful tips for your new website are given below.
-Always pick a theme that fits your website best.
-Install all the necessary plugins such as SEO plugins, Security plugins, etc.
-Make sure you’re not overloading your website with unnecessary plugins. Choose plugins according to features and functionality you need on your site.
Subdirectories can be your good friends if you want to add more functionality to your site. Hopefully, this tutorial will help you add WordPress in a subdirectory hassle-free. If you have any query lets us know in the following comment section.