How2Lab Logo
tech guide & how tos..


Where and how to upload your website files on an Internet server?


You have built your website on your local computer and now need to host it on an internet server. How do you go about doing it?

As a first step you need to buy a domain name and a hosting plan from a web services provider. After you have purchased a Web Hosting package for your domain name, your hosting provider will send you a welcome email containing basic details of how to access your hosting account control panel. Typically, if you purchase a windows hosting plan, you would be provided with a Plesk control panel, and if you purchase a linux hosting plan, you would be provided with a cPanel. Additionally, your hosting provider would also provide you with ftp login details. You will need to upload your website files, setup databases, if any, and create email accounts.

A lot of help is available from within your cPanel/Plesk control panel on how you can setup databases and email accounts.

In this article and a series of subsequent articles, I will only cover where and how you can conveniently upload your website files using a standard ftp client.


Uploading your website using FTP

You can configure and use any FTP client to upload content to your website hosting server. In subsequent articles I will deal with this in more detail to explain how to upload your website files using various ftp clients. You can use any one of the various ftp clients available. Most of the ftp client software are available free on the internet and you can download any one and install it on your computer.


Where to put the contents of your website?

A website that you host on an internet server would have a well-defined directory structure. Given below is the directory structure for Plesk and cPanel managed hosting accounts, to help you understand the significance of each directory for your website.


Windows PLESK

Directory and File Structure of a Plesk Windows Hosting package

From amongst the several directories found within your Plesk Windows Hosting package, the following are relevant and important:

DirectoryContents
\httpdocs This is your website's home directory. It should contain all files that are part of the website. Any file and folder inside this directory is visible over the Internet unless you password protect it.
\error_docs When visitors come to your site and request pages that the web server cannot find, the web server generates and displays a standard HTML page with an error message. The standard error messages may inform of problems but they do not usually say how to resolve them. You can create your own error pages and upload them in this directory.

For Plesk Windows Hosting package, upload your website content to the httpdocs folder.


File Structure

A typical Plesk setup will check for the existence of one of the below files and based on the order specified below, will display its content as the home page, when anyone tries to access your website with the url www.yoursite.com. Also, if anyone tries to access any sub-folder under httpdocs with the url www.yoursite.com/sub-folder-name, the web server will try to locate a file with one of the below listed names, in order, and send it across to the requesting web browser.

  1. index.html
  2. index.htm
  3. index.cfm
  4. index.shtml
  5. index.shtm
  6. index.stm
  7. index.php
  8. index.php3
  9. index.asp
  10. index.aspx
  11. default.htm
  12. default.asp
  13. default.aspx

Note that the PLESK control panel allows you to modify the above list, i.e. you can:

  1. Remove some of the file names from the above list
  2. Add your own names to the list
  3. Change the order of the index file names in the list

The web server will essentially look for existence of the above listed file names in order from top to bottom, and the first file that it finds, it will proces it and return the results to the requesting website visitor's web browser.

If you were to upload a file index.html within the httpdocs folder of your website www.yoursite.com, then when a website visitor tries to reach either yoursite.com or www.yoursite.com, then he/she would be automatically displayed the contents of the index.html file. This happens since the web server treats the index.html file as the home page or default page for the domain.

Similarly, if you were to upload an index.html file within the /httpdocs/plants folder (as example), then when a website visitor types yoursite.com/plants or www.yoursite.com/plants, then he/she would be automatically displayed the contents of the index.html file within the plants sub-folder.

Now, if you were to upload two or more files from amongst the list given above, then the one mentioned higher in the order will be considered as the home page. So in the event that there exists an index.php and default.htm file within the same folder, then the index.php file will get considered as the home page.



Linux cPanel

From amongst the several directories found within your cPanel Linux Hosting package, only the following are important:

DirectoryContents
/public_html This is the home directory of your website and it contains all files that are part of the website. Any file and folder inside this directory is visible over the Internet unless you password protect it.
/wwwThis is simply a link/alias to the public_html directory.

On a cPanel Linux Hosting server, upload your website content to the public_html folder. Do not upload under www folder. The folder www is simply a link/alias to the public_html folder.


File Structure

A cPanel Linux Hosting server will check for the existence of one of the below files and based on the order specified below, will display its content as the Home Page, when anyone tries to list the content of any folder/directory:

  1. index.html
  2. index.htm
  3. index.php
  4. index.php3
  5. index.php4
  6. index.shtml
  7. default.html
  8. default.htm
  9. default.php
  10. home.html
  11. home.htm
  12. home.php
  13. index.pl
  14. home.pl
  15. default.pl

If you were to upload a file index.html within the public_html folder of your website yoursite.com, then when a website visitor tries to reach either yoursite.com or www.yoursite.com, he/she will be automatically displayed the content of the index.html file. This happens since the server treats the index.html as the home page or default page for this directory.

Similarly, if you were to upload an index.html file within the /public_html/plants folder, then when a website visitor types yoursite.com/plants or www.yoursite.com/plants, he/she will be automatically displayed the content of the index.html file within the plants sub-folder.

Now, if you were to upload two or more files from amongst the list given above, then the one mentioned higher in the order would be considered as the home page. So in the event that there exists an index.php and default.html file within the same folder, then the index.php file will get considered as the home page.


Important:

Make sure that the computer that you use to access your hosting account either via cPanel/Plesk control panel or via ftp, is absolutely free of any viruses or spywares. Also, make sure that your website files themselves are free of viruses or malware. It is very important to have a genuine licensed version of a good anti-virus software installed in your local computer, which is periodically updated with latest virus and malware signatures.


Accessing your Website

After you have uploaded your website files on our hosting server, you may preview your website by visiting the website as you would visit any other website. Make sure that your name servers have propagated before you visit your website so that your domain is pointing to your hosting server. It normally takes 24-48 hours for name server propagation.


Share:
Buy Domain & Hosting from a trusted company
Web Services Worldwide
About the Author
Rajeev Kumar
CEO, Computer Solutions
Jamshedpur, India

Rajeev Kumar is the primary author of How2Lab. He is a B.Tech. from IIT Kanpur with several years of experience in IT education and Software development. He has taught a wide spectrum of people including fresh young talents, students of premier engineering colleges & management institutes, and IT professionals.

Rajeev has founded Computer Solutions & Web Services Worldwide. He has hands-on experience of building variety of websites and business applications, that include - SaaS based erp & e-commerce systems, and cloud deployed operations management software for health-care, manufacturing and other industries.


Refer a friendSitemapDisclaimerPrivacy
Copyright © How2Lab.com. All rights reserved.