Understanding the Home (index.html) File
The index.html file is the default file for any web directory. This means that when visitors access your website at http://www.yourdomain.com, the server automatically loads http://www.yourdomain.com/index.html. This behavior applies to all publicly accessible directories on your hosting account, including any subdomains.
Key Points to Remember:
-
Main Website File:
When uploading your website's main files to a directory, always name the main page index.html (or index.htm). This file will be served by default when users visit your domain or any subdirectory. -
Non-HTML Websites:
If your website is built with technologies like PHP or SHTML, the default file should be named accordingly:- For PHP-based websites: index.php
- For SHTML-based websites: index.shtml
Make sure the main file is named index.extension (e.g., index.php, index.shtml) if your website is not based on HTML.
Why the Index File is Important:
- The index.html (or similar files) is what ensures visitors see your homepage when they visit the root directory of your website or any subdirectories.
- It’s essential for organizing the structure of your website and providing a default page that is easily recognized by web servers.