While working on your websites, you may encounter the need to access what is referred to as the root directory, root folder, document root, or some other alternative. The following article contains instructions on how you can view/access this folder.
If you are managing the technical work of your website then a lot of time you heard these two terms “Upload file to the root directory of your website” or “Upload file to the public_html folder“, I’m right. Well, both these terms have the same meaning and referring to do the same thing.
What is the Root Directory?
Root directory means the folder which contains all the file of software (like a window, C-drive is the root drive of window) and
Public_html, if you working on a server (hosting) then root directory refers to a public_html folder (we can say, its a C-drive of the Cpanel, where all installed files of the WordPress is stored).
It does not matter which taxonomy “Upload file to the root directory of your website” or “Upload file to the public_html folder” you are using to upload a file.
In a computer file system that is organized as a pyramid or tree, the root directory is the directory that includes all other directories. (Unlike a real tree, a hierarchy file system has only one root!) In UNIX-based as well as in other operating systems, the root directory has no name. It is simply characterized by the special character that separates directories in a file system.
If you need to upload files to the server, then you have to find the root directory first and that’s what we are exactly going to do in this article.
The Primary purpose of this article is to explore the way to,
- How to find the root directory of WordPress website
- How To upload the file to public_html folder
So, let’s us start.
How To Find Root Directory Of WordPress Website
The root directory is the folder that stores all the files for your website and that folder name is public_html on the server (Cpanel). By default, it’s your primary domain folder.
For example, If “exmaple.com” is your primary website name then your root directory is “public_html/”
But, when you add the Addon domain to your Cpanel, it will create a new folder in your “public_html” folder.
For example, Suppose I add “example2.com” in my Cpanel then “public_html/exmaple2” Is my root folder for the “exmple2.com” domain.
Note: The document root for a subdomain is a bit different. If your subdomain is “abc.example.com”, then the document root folder would be “public_html/abc”.
- Login your Cpanel and open your File_Manager.
Note: Hitechwork.com is my primary domain, so the root directory of hitechwork.com is “public_html” by default.
As I told you, all the new domain or subdomain, You will add in the Cpanel, it will be added, under the public_html folder.
- Have a look at the below screenshot.
All the new domain is added in the public_html folder.
Note: You can also install WordPress into subdirectory WordPress during installation.
If you are not sure about the root directory of addon domain then you also can check it by;
- Login you Cpanel and click on Addon.
Note: Addon domain is an additional domain which you host on the same server.
- Here you can see you all addon domain and its root directory expected your Primary domain.
addon domain root directory you can also edit the path or redirect website A to website B if you want.
Quick table guide to understanding Document Root Structure
|Domain type||URL path||File Structure|
In this way, you can find the root directory of the WordPress website.
So, let move to our next step.
How To Upload File To The Root Directory Of website
There is a lot of methods to upload the file to the root directory, for example by using the FTP account, From Cpanel, From inside the WordPress.
Below is some case when you need to upload the file to the root directory.
- When you have to Upload XML sitemap file to WordPress
- When you have to Upload robots.txt file to WordPress
- When you have to verify website with HTML file Upload method
- Or have to verify third-party services like Zoho mail, mailer lite, MailChimp, etc.
To upload a file, click on File_Manager in the Cpanel and find the root directory where you want to upload the file.
Note: Here I’m going to upload the file to the root of my primary domain.
- Select the root directory and click on upload.
When you click on upload a new window will be open with the upload option.
- Select the file that you want to upload and hit the submit button.
It’s done. your file is in the root folder. If you are using WordPress then you can use a plugin called File Manager. But sometimes this plugin does not work because your hosting not allowed to upload files due to security reasons.
- Install and active File Manager Plugin on WordPress.
- Click on File Manager, Select the root directory and upload the file
If you don’t have access to Cpanel and this method does not work then you can use the FTP account method. To get the login detail of the FTP account, contact your hosting provider.
So, in this way, you can upload the file to the root directory of the WordPress website.
Remember to share this post with anyone who might benefit from this information, including your Facebook friends, Twitter followers, and members of your Google+ group!
Also Support Us By Liking Our Facebook, Twitter, and Google+ Page.
If you have any suggestions or problems with “how to find the root directory of the WordPress website,” then please feel free to comment below.
- Philo vs Sling TV in 2021 – Which One is Better? - July 29, 2020
- How to Create FREE Edu Email in 2021 [100% Working Method] - July 27, 2020
- How to Add Bots to Discord Server [2020-21] - July 22, 2020