GlossarySpanish version

Support article

What is index.html and what is it used for

Learn what the index.html file is, why it matters in your web hosting and how to use it correctly on your website.

Published: 23/06/2026Updated: 23/06/2026

Introduction

When you upload a website to your hosting, one of the most important files is index.html. Although the name may sound technical, its role is very simple: it is usually the file shown first when someone visits your domain.

In this article, you will learn what the index.html file is, what it is used for, where it should be placed and what to check if your website does not display correctly when someone enters your domain.

What is the index.html file

The index.html file is the main page of a website.

When someone types your domain into the browser, for example:

https://yourdomain.com

the server automatically looks for a starting file inside the main folder of the site. In many cases, that file is called:

index.html

If the server finds it, it shows its content to the visitor.

For example, if you have a simple website with a welcome page, that page may be stored as index.html.

What is index.html used for

The index.html file tells the server which main page should load when someone enters your website.

Its most common uses are:

  1. Showing the home page of a website.
  2. Creating a temporary page while the full site is being finished.
  3. Displaying a simple informational page.
  4. Serving as the base for websites made with HTML, CSS and JavaScript.
  5. Preventing the browser from showing a directory listing.

In short: if your domain is the entrance to your website, index.html is often the first page the visitor sees.

Where to place the index.html file

The index.html file should be placed in the main folder of the domain inside your hosting account.

Depending on the control panel or service configuration, this folder may have different names, for example:

public_html

or it may be inside a domain-specific path such as:

domains/yourdomain.com/public_html

In panels such as DirectAdmin or cPanel, you can usually access this folder from the file manager inside the hosting panel.

Steps to upload an index.html file to your hosting

Sign in to your hosting control panel

Access your hosting panel from the client area or from the access URL provided by miHosting.

It may be a panel such as DirectAdmin or cPanel, depending on the service you ordered.

Open the file manager

Look for the option called File Manager or something similar.

This tool lets you view and manage your website files without needing external software.

Access the main folder of the domain

Open the folder where your website should be published. In many cases it will be:

public_html

If you have several domains in the same hosting account, make sure you open the folder for the correct domain.

Upload the index.html file

Use the upload option and select the index.html file from your computer.

Check that the name is correct

The file should be named exactly:

index.html

Avoid names such as:

Index.html
home.html
index.html.txt

On some servers, uppercase and lowercase letters matter. That is why using index.html in lowercase is the safest choice.

Open your domain in the browser

Visit your domain to confirm that the file displays correctly:

https://yourdomain.com

If everything is configured properly, you should see the content of your main page.

Basic example of an index.html file

A simple index.html file may contain something like this:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My first website</title>
</head>
<body>
  <h1>Welcome to my website</h1>
  <p>This is my home page.</p>
</body>
</html>

This example shows a basic page with a heading and a welcome message.

What happens if there is no index.html

If there is no index.html file or equivalent main page, several things may happen:

  1. The browser may show an error.
  2. The server may show a default page.
  3. A directory listing may appear.
  4. The website may load another main file, such as index.php.

This depends on the server configuration and on the type of website you are using.

For example, if you have a WordPress website, the main file is usually not index.html, but index.php.

Difference between index.html and index.php

Although their names look similar, they are not exactly the same.

The index.html file contains a static page. That means the content is shown exactly as it is written in the file.

The index.php file, by contrast, can generate dynamic content. It is very common on WordPress websites, online stores, content management systems and web applications.

Simple example:

index.html -> static website
index.php  -> dynamic website

If your site is built only with HTML, CSS and JavaScript, you will probably use index.html.

If your site runs on WordPress or another CMS, you will probably use index.php.

Useful tips

  • Always check the correct folder. If you upload the index.html file to the wrong folder, your domain will not show the page. Make sure it is published in the main folder of the domain.
  • Use the exact file name. The recommended name is index.html, all lowercase and without spaces.
  • Do not delete files unless you know what they do. If you already have a working website, do not remove files such as index.php, site folders or CMS files unless you are sure. You could take the site offline.
  • Avoid uploading duplicate start files. If you have both index.html and index.php, the server may prioritize one over the other depending on its configuration. If your site is not loading as expected, review which file is being used as the main page.
  • Use a temporary page if your website is not ready yet. You can create a simple index.html with a message such as “Site under construction” while you finish building your website.

Frequently asked questions

Is the index.html file mandatory

Not always, but it is highly recommended for static websites. In many cases, the server needs a main file to know which page to display when the domain is visited.

Can I change the name of index.html

You can have files with other names, but if you want a page to load automatically when someone enters the domain, the normal approach is to use index.html, index.php or another file defined as the start page on the server.

Why does my domain not show the index.html file

There may be several causes:

  1. The file is in the wrong folder.
  2. The file name is not written correctly.
  3. There is another start file with higher priority.
  4. The domain does not yet point to the correct hosting account.
  5. The browser cache is showing an older version.

If you recently changed your domain DNS, remember that propagation can take some time.

Can I create an index.html file from the hosting panel

Yes. In many hosting panels, you can create a new file from the file manager, name it index.html and edit it directly from the browser.

Do I need programming knowledge

To create a very basic page, you do not need advanced knowledge. However, to design a complete and professional website, it does help to know HTML, CSS and other web development tools.

Relationship with your hosting service

The index.html file is a basic part of how any website works when it is hosted on a hosting service.

At miHosting, you can use it in different services, such as:

  • Professional hosting to publish your website.
  • Free hosting for simple projects or tests.
  • Reseller hosting if you manage websites for several clients.
  • VPS or dedicated servers if you need more control over server configuration.

It can also be useful to combine your site with other services such as domain registration, SSL certificates, backups or website maintenance, especially if you want your project to be more secure and professional.

Conclusion

The index.html file is the main page that usually loads when someone visits your domain. It is a simple file, but very important for helping your website work correctly.

If you are creating a basic website, make sure you upload index.html to the correct folder, use the exact file name and confirm that your domain points to the right hosting account.

If, after checking these steps, your site still does not display as expected, you can contact miHosting technical support for help reviewing your domain, hosting and website file configuration.