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. We also discussed a method to upload files to WordPress root directory using FTP.
Use FTP To Upload Files To The WordPress Root Directory.
There are others methods of how to upload files to WordPress. In this section, I will guide you to upload files using FTP localhost. Using the FTP protocol you can easily manage, upload, download, and delete or edit any file in your WordPress root directory. We are using this Protocol because FTP enables files to be downloaded or uploaded between computers.
But, to do that you need to install the FTP client software on your computer. There are various softwares available for this purpose like FileZilla, WinSCP, and Cyberduck. I will guide you to the method using FileZilla. To use FileZilla, please make sure you have a Bluehost subscription, and carefully follow the steps in this FileZilla tutorial.
How to connect Filezilla to WordPress:
- Open FileZilla, Go to the File
- Click on Site manager.
- Click on the New Site from the buttons below.
- Enter your Host (Domain Name).
- Select SFTP as Protocol (if supported by the hosting provider, otherwise select FTP).
- Enter your Username and FTP password.
- In the Transfer Settings tab set the simultaneous connection limit to 8.
- Click on the Connect
If you are a new user and signing up for the first time you will be asked to accept the certificate to connect to the WordPress FTP server for future use, accept the certificate, and continue to send files via FTP to the WordPress root directory.
And now for the main question, how to upload files to WordPress? That is a simple and easy process, but, you need to be careful when you upload files to the WordPress root directory as you just cannot upload the files anywhere.
After FileZilla is logged in, you will see two columns “Local site” where you would see the local files on your computer, and “Remote Site” which shows the files of your WordPress site.
Browse the files from “local site” column that you want to upload to WordPress using FTP, right-click on the file and click on Upload. You can follow a similar process to upload a WordPress theme and plug-in using FTP.
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.